Код стандартный:
#define NOMINMAX
#include <iostream>
#include <windows.h>
#define CURL_STATICLIB
#include "curl/curl.h"
#include <src/api.h>
#include "src/json.hpp"
int main()
{
VK::Client api;
}
Ошибки:
1>ConsoleApplication8.obj : error LNK2001: неразрешенный внешний символ "public: virtual bool __thiscall VK::Attachment::User::parse(class nlohmann::basic_json<class std::map,class std::vector,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool,__int64,unsigned __int64,double,class std::allocator,struct nlohmann::adl_serializer> const &)" (?parse@User@Attachment@VK@@UAE_NABV?$basic_json@Vmap@std@@Vvector@2@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@_N_J_KNVallocator@2@Uadl_serializer@nlohmann@@@nlohmann@@@Z).
1>ConsoleApplication8.obj : error LNK2019: ссылка на неразрешенный внешний символ "public: __thiscall VK::Client::Client(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__cdecl*const)(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &),class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > (__cdecl*const)(void))" (??0Client@VK@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0Q6A?AV23@ABV23@@ZQ6A?AV23@XZ@Z) в функции _main.
1>C:\Users\Maxim\source\repos\ConsoleApplication8\Debug\ConsoleApplication8.exe : fatal error LNK1120: неразрешенных внешних элементов: 2
Все в проекте настроил, и библиотеки подключил, и зависимости.
In Project Properties -> VC++ Directories -> Include Directories add C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\include\
In Project Properties -> VC++ Directories -> Library Directories add C:\curl\builds\libcurl-vc-x86-release-static-ipv6-sspi-winssl\lib\ there
In Project Properties -> Linker -> Input -> Additional Dependencies add libcurl_a.lib, Ws2_32.lib, Crypt32.lib, Wldap32.lib and Normaliz.lib
LIBS += -lcurlВам поможет, если линковщик сможет найти библиотеку – KoVadim Dec 12 '21 at 12:22int main() { VK::Client api;
} Ошибки те же, но все вроде подключено, и библиотеки, и зависимости.
– Максим Смирнов Dec 12 '21 at 15:41