Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Unresolved external symbol - Boost [ Socket-io ]

Hi guys,

The past 2 days, I have tried to make a console application that connects to a Socket-io Back-End. I'm not experienced in c++ and configuring external dependencies.

The errors I get:

Code
Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK1120    2 unresolved externals    ConsoleSocketIO    ...\x64\Debug\ConsoleSocketIO.exe    1    
Error (active)    E1097    unknown attribute "no_init_all"    ConsoleSocketIO    C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h    3886    
Error    LNK2001    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)    ... \sio_client_impl.obj    1    
Error    LNK2001    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)    ... \sio_socket.obj    1    
Error    LNK2019    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'errno_ecat''(void)" (??__Eerrno_ecat@system@boost@@YAXXZ)    ... \sio_client.obj    1    
Error    LNK2001    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ)    ... \sio_client_impl.obj    1    
Error    LNK2001    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ)    ... \sio_socket.obj    1    
Error    LNK2019    unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "public: __cdecl boost::system::error_code::error_code(void)" (??0error_code@system@boost@@QEAA@XZ)    ... \sio_client.obj    1

I have search for hours on google, on some says :

- The error came from the fact that im trying to compile my application in 64 bit and Boost library is in 32 bits.
- I need to put extra defined constant in the header of my files, in order to skip these kind of error.

Im Using:

- Boost 1.55.0:
https://www.boost.org/users/history/version_1_55_0.html

- RapidJson 1.1.0:
https://github.com/Tencent/rapidjson/releases

- Websocketpp 0.8.1:
https://github.com/zaphoyd/websocketpp/releases

- Visual Studio 2019
- C++14
- Windows 10

I have included the dependencies via VC++ Directories.

Im really lost on this. Can someone please give me hints, on help on this ? I have posted the solution on GitHub which you guys can download.

GitHub Source:
https://github.com/isaelblais/socket-io-console.git

Thanks in advance
Maype
According to this link(from your link) you can download 64 bit binaries.

https://sourceforge.net/projects/boost/f...es/1.55.0/

Why are you downloading an old Boost version?
May you be given directions by software engineer document writers.
Good questions... I Have tried with version 1.66.0 in 64 bit and it still does not work. I am using old version of boost because it the version required by the example I am using thats requires version 1.55.0 minimum.
I have tried using websocketpp but then I stumbled upon across this:
https://github.com/machinezone/IXWebSocket

I very much prefer it and it because the code is cleaner and the library has no dependencies. Maybe you shalt try that library out.
(Mar 31, 2020 11:51 AM)maype Wrote:  Good questions... I Have tried with version 1.66.0 in 64 bit and it still does not work. I am using old version of boost because it the version required by the example I am using thats requires version 1.55.0 minimum.

If its a problem with word size, then compile it as a 32bit program. C/C++ compilers are very accommodating.

I would try a C++ program with a simple Boost library and see if you can get that to compile. If that compiles then I would try adding the others.

Node: I would memorize this link -> https://www.boost.org/doc/libs/1_72_0/mo...ndows.html

From that page
Quote:Most Boost libraries are header-only: they consist entirely of header files containing templates and inline functions, and require no separately-compiled library binaries or special treatment when linking.

May you be given directions by software engineer document writers.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by ShxtdownFeb 7, 2019 08:20 PM 7 300 Feb 7, 2019 08:20 PM
Last Post: Caliban
[C] by FruitcakeJul 26, 2017 07:26 PM 2 184 Jul 26, 2017 07:26 PM
Last Post: 0xDEAD10CC
[C] by steamstrikerMar 23, 2016 04:24 AM 0 165 Mar 23, 2016 04:24 AM
Last Post: steamstriker