Undefined symbols for architecture x86_64
innerNULL opened this issue · comments
REALLY needs help with this 'Undefined symbols for architecture x86_64:' error T T
Here is my codes
#include "oatpp-websocket/WebSocket.hpp"
#include "oatpp-websocket/Connector.hpp"
#include "oatpp/network/tcp/client/ConnectionProvider.hpp"
#include <thread>
int main(int argc, char **argv) {
//auto connectionProvider = oatpp::network::tcp::client::ConnectionProvider::createShared({"echo.websocket.org", 80});
//const std::shared_ptr<oatpp::websocket::WebSocket> websocket;
oatpp::base::Environment::init();
return 0;
}
And here is my compile error:
[ 50%] Building CXX object CMakeFiles/demo.dir/demo.cpp.o
[100%] Linking CXX executable demo
Undefined symbols for architecture x86_64:
"oatpp::base::Environment::init()", referenced from:
_main in demo.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [demo] Error 1
make[1]: *** [CMakeFiles/demo.dir/all] Error 2
make: *** [all] Error 2
My fault, forgot link oatpp lib.