danaxwap.blogg.se

Undefined reference to c++
Undefined reference to c++














How do I go around working out why this won't compile?

#UNDEFINED REFERENCE TO C++ INSTALL#

I installed Boost using this command: sudo apt install libboost-dev Main.cpp:(.text._ZN5boost4asio5error19get_system_categoryEv+0x8): undefined reference to `boost::system::system_category()'Ĭollect2: error: ld returned 1 exit status usr/bin/ld: /tmp/ccGWgmo2.o: in function `boost::asio::error::get_system_category()': usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei+0x1fc): undefined reference to `boost::system::generic_category()' usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei+0x118): undefined reference to `boost::system::generic_category()' Main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei+0xcc): undefined reference to `boost::system::generic_category()' usr/bin/ld: /tmp/ccGWgmo2.o: in function `boost::system::error_category::std_category::equivalent(std::error_code const&, int) const': usr/bin/ld: main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition+0x118): undefined reference to `boost::system::generic_category()' Main.cpp:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition+0xcc): undefined reference to `boost::system::generic_category()' usr/bin/ld: /tmp/ccGWgmo2.o: in function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const': Main.cpp:(.text._ZN5boost6system10error_codeC2Ev+0x1c): undefined reference to `boost::system::system_category()' St::cout << "Socket closed." << std::endl Īnd this is the compile command: g++ -lpthread -lboost_system main.cpp -o testīut when I try to compile the program I get this error: /usr/bin/ld: /tmp/ccGWgmo2.o: in function `boost::system::error_code::error_code()': Std::cout << "Socket opened!" << std::endl Std::cout << "Hello World!" << std::endl I created a simple program in C++ on my RPi to test the Boost library.














Undefined reference to c++