Giter Site home page Giter Site logo

Comments (5)

braindigitalis avatar braindigitalis commented on May 4, 2024 1

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.

kevlu8 avatar kevlu8 commented on May 4, 2024

Thank you, I'll try that

from dpp.

kevlu8 avatar kevlu8 commented on May 4, 2024

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.

braindigitalis avatar braindigitalis commented on May 4, 2024

....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.

braindigitalis avatar braindigitalis commented on May 4, 2024

https://github.com/kevlu8/Discord-Utilities/blob/main/Discord%20Utilities/Discord%20Utilities.cpp#L185

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.