Comments (5)
please show your source code plus full error output not a cropped screenshot.
did you build dpp from source, or use one of the pre built releases?
this is an issue with your project settings not an issue with the library or it would be happening for everyone.
is your project set as C++17 in the settings?
remember that you can't just include the dpp.h header and need to configure your project to include dpp.lib and also ensure that the opus and sodium etc headers are available. did you follow the setup steps here: https://dpp.dev/build-a-discord-bot-windows-visual-studio.html
*NOTE THAT OUR PREBUILT VERSIONS ARE FOR VS2019 NOT 2022 so this may have an effect on your attempts to build the bot if you are using prebuilt binaries.
from dpp.
Thank you, I'll try that
from dpp.
I have changed all my settings: I added the libraries and set the project to C++ 17 but I'm still getting all the errors. I also switched to VS2019. I'm using the release provided in the releases page.
Here's my source code:
#include <dpp/dpp.h>
#include <dpp/nlohmann/json.hpp>
void sendWebHookMsg(std::string msg) {
dpp::webhook hook = dpp::webhook::webhook();
nlohmann::json j;
j["type"] = 1;
j["name"] = "testhook";
j["channel_id"] = "901956282964136016";
j["guild_id"] = "901956232510844989";
j["application_id"] = NULL;
j["token"] = "token was here";
j["content"] = msg;
hook.fill_from_json(j);
hook.build_json(true);
}
int main() {
sendWebHookMsg("Hello, world!");
}
I'm still getting many errors:
Severity Code Description Project File Line Suppression State
Error (active) E0283 qualified name is not allowed TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 79
Error (active) E0065 expected a ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 79
Error (active) E0283 qualified name is not allowed TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 55
Error (active) E0065 expected a ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 55
Error (active) E0020 identifier "command_parameter" is undefined TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 126
Error (active) E0283 qualified name is not allowed TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error (active) E0065 expected a ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 412
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 412
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 412
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 412
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 414
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 414
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 414
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 414
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 416
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 416
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 416
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 416
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 418
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 418
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 418
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 418
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 420
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 420
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 420
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 420
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 422
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 422
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 422
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\message.h 422
Error C2039 'variant': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error C2039 'monostate': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 65
Error C3646 'value': unknown override specifier TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 76
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 76
Error C2061 syntax error: identifier 'command_value' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 89
Error C3646 'value': unknown override specifier TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 272
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 272
Error C2039 'variant': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 348
Error C2059 syntax error: '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 348
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\slashcommand.h 348
Error C2039 'optional': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\auditlog.h 141
Error C2143 syntax error: missing ';' before '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\auditlog.h 141
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\auditlog.h 141
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\auditlog.h 141
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 169
Error C2143 syntax error: missing ';' before '&' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 169
Error C2433 'dpp::interaction_create_t::command_value': 'virtual' not permitted on data declarations TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 169
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 169
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 191
Error C2143 syntax error: missing ';' before '&' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 191
Error C2433 'dpp::button_click_t::command_value': 'virtual' not permitted on data declarations TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 191
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 191
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 214
Error C2143 syntax error: missing ';' before '&' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 214
Error C2433 'dpp::select_click_t::command_value': 'virtual' not permitted on data declarations TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 214
Error C2238 unexpected token(s) preceding ';' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\dispatcher.h 214
Error C2039 'variant': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 79
Error C2059 syntax error: '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 79
Error C3646 'value': unknown override specifier TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 173
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 173
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 187
Error C2143 syntax error: missing ',' before '&' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\cluster.h 187
Error C2039 'variant': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 55
Error C2059 syntax error: '<' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 55
Error C2039 'monostate': is not a member of 'std' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 55
Error C2065 'command_parameter': undeclared identifier TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 126
Error C2923 'std::pair': 'command_parameter' is not a valid template type argument for parameter '_Ty2' TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 126
Error C3203 'pair': unspecialized class template can't be used as a template argument for template parameter '_Ty', expected a real type TestHook C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\dpp\commandhandler.h 126
from dpp.
....why is dpp in the msvc folder in program files of visual studio 2015?
You are using visual studio 2015 compiler in 2019 (14.29.30133). This is not supported as is it does not support C++17 features.
You havent set this as a C++17 project as its failing on trying to find std::variant which is a C++17 feature.
Also your entire program is wrong. This is not how you use the library or C++ in general. You can't instantiate a class by calling its constructor like a static and should not be trying to build JSON by hand. Populate the fields instead!
Start with the example template: https://github.com/brainboxdotcc/windows-bot-template and take dpp out of the program files folder! (why is it there? the tutorials on our site do not say to do this)
Take a look also at some of the example programs on dpp.dev to see how to use the library. If you are still stuck, please come to the support server at https://discord.gg/dpp
from dpp.
you cant be serious, right?
We will not assist you in creating programs to break discord terms of service.
This issue is closed.
from dpp.
Related Issues (20)
- Online unit tests fail on Mac Silicone. HOT 1
- xmake dpp.lib(cluster.cpp.obj) : error LNK2019 HOT 12
- `dpp::on_voice_receive_combined` called only once per tick, with not enough samples HOT 1
- Feature Request: Configurable audio receive tick interval HOT 6
- FindSodium.cmake should support MinGW HOT 4
- Undefined behavior in dpp::populate_result when accessing non-existent headers HOT 7
- Accessing deleted timer in cluster::tick_timers HOT 1
- 1 test fails: ts_not_null() HOT 13
- dpp::cluster on_message_create callback not does not trigger when cluster is created using i_message_content intent HOT 4
- on_voice_receive, on_voice_receive_combined, and on_voice_user_talking never trigger events HOT 12
- Memory leak in request_queue when sending messages with files HOT 8
- Add an ability to tell if a message was created in a thread, or to get the thread that a message was posted in. HOT 7
- How to get a channel id on channel create? HOT 2
- set_presence() giving error 4002: decode error HOT 6
- dpp::discord_voice_client: track_meta is not cleared when stop_audio() is called HOT 3
- certain error types from discord API can cause a core dump HOT 1
- std::basic_string<uint8_t> is broken for LLVM-19 HOT 4
- Mingw integration/help HOT 1
- Add support for other encryption / decryption methods supported by discord HOT 4
- Bug: can not install .rpm on Fedora40 HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dpp.