kRPC: Control the game using C#, C++, Java, Lua, Python...

kRPC: Control the game using C#, C++, Java, Lua, Python...

7.8k Downloads

C++ Client build script fails to link all objects

yehoodig opened this issue ยท 2 comments

commented

I followed the instructions to build the C++ client. I had a lot of problems, but I eventually figured out where I was being stupid with building protobuf. Got that fixed, then ran the build scripts for the client. They seemed to work. Then I moved on to the example project, copied the code exactly and compiled. Many undefined references.
I was able to resolve the problem, by sourcing the krpc client source files AND the library when compiling. It only works with both, not one or the other,

which I think means that not all the files are getting linked into the library. <--- Only thing you actually need to read

But, It has been a LONG time since I've played with C++ or Make, so I could be being stupid somehow, and I don't know how to fix it.

This is the compiler command that finally got it to work:

g++ main.cpp krpc-cpp-0.4.4/src/stream_impl.cpp krpc-cpp-0.4.4/src/event.cpp -std=c++11 -lkrpc -l:libprotobuf.so.14 

Thank You,
JM

commented

Quick update, after some more checking around, I think stream_impl.cpp and event.cpp are the only ones that didn't get linked.

commented

Uh...okay...well it works now...I don't know why. I deleted the library, and then rebuilt using the ./configure method.