Hello there, I know this topic has been posted here before, but thatdidn't help me much and was too old, so i thought i would rather start a new thread.
I ran the following commands in RakNet root directory(not /Source)
cmake -i
It asks about the install directory whick is by default pointed to 'usr/local/'. I keep it as it is.
Final line of output is Build Successfull. So i Guess no problem here
make && make install
Output looks fine. The fils are attached below
[attachment=27001:cmk.txt]
[attachment=27002:mk.txt]
[attachment=27003:mkinstall.txt]
now, when i compile the file with the command -
g++ main.cpp -lRakNet -lpthread -lrt
Aside from some deprecated warnings, it gives me the error -
/usr/bin/ld: cannot find -lRakNet
So, When i looked into /usr/local, there wasn't a single file or folder of RakNet there.
Hence, I tried
g++ main.cpp -lpthread -lrt -L/pat-to-lib/libRakNetLibStatic.a
Still no luck, got some undefined function errors(i.e. Didn't link at all).
I also tried what was prescribed in Raknet Readme.
Running cmake in /Source appears to be fine, but dosen't solve the problem when I compile it.
Running the following in /Source
g++ -lpthread -g *.cpp
gives
usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
Which usually occurs when there is no main() in program.
So, finally, my question is -
How to Compile / Link Raknet properly in Linux ?
According to best of my knowledge, i have compiled just fine, but am not able to link the file properly.