Code Monkey home page Code Monkey logo

Comments (11)

maxsupermanhd avatar maxsupermanhd commented on September 21, 2024 1

Yep, with latest fixes everything seems to be building fine, thanks!

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

It seems to be very similar to #5 but with a link error from openSSL instead of protocolcraft.

From what I see, you don't seem to have openSSL on your system, so botcraft is using the included one, but can't link to it afterward. I'll try to see what I can do.

In the meantime, you can try either try to:

  • install openssl directly on your system or
  • manually add the magical line set_property(TARGET ssl // crypto PROPERTY POSITION_INDEPENDENT_CODE ON) after the add_library in both 3rparty/openssl/ssl/CMakeLists.txt and 3rdparty/openssl/crypto/CMakeLists.txt

from botcraft.

todest avatar todest commented on September 21, 2024

I sawed OpenSSL has been installed in my system, and I reinstalled it, but it didn't work. So i used the second solution, it succeed, Cheers.

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

Yes botcraft installs openSSL if it does not find it. But only locally, not on your system. And this local installation is apparently not working because of the PIC thing

Glad it solves the problem for you, will try to fix it.

from botcraft.

maxsupermanhd avatar maxsupermanhd commented on September 21, 2024

Same but with glad, can not find a setting for one...
UPD: found one but setting seems to be turned on but still having error...

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

@maxsupermanhd could you elaborate on your error? Is the glad library found on your system or is it the one included in this repo that is built?

If it's not on your system, you should have a message Can't find glad, building it from sources the first time you call cmake.

from botcraft.

maxsupermanhd avatar maxsupermanhd commented on September 21, 2024

For some reason it decided to build it's own version even if I have one installed, here is full log:

make -j4
[ 33%] Built target protocolCraft
[ 35%] Linking CXX shared library ../../bin/libbotcraft.so
/usr/bin/ld: ../3rdparty/glad/install/lib/libglad.a(glad.c.o): relocation R_X86_64_PC32 against symbol `glad_glGetString' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [botcraft/CMakeFiles/botcraft.dir/build.make:526: ../bin/libbotcraft.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:244: botcraft/CMakeFiles/botcraft.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I tried appending -DCMAKE_CXX_FLAGS=-fPIC to cmake configuration but that does not worked...

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

Ok thanks for the details. I'm currently working on a fix that should work for both openssl and glad.

Where did you add -DCMAKE_CXX_FLAGS=-fPIC? Because dependencies are built in a separate cmake process (for example here for glad). If you added it in the botcraft cmake call, it would just tell cmake to add -fPIC to protocolCraft and botcraft, which already have it. And btw, I think that a more "cmakeish" way of doing it would be -DCMAKE_POSITION_INDEPENDENT_CODE=ON.

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

I've added the cmake line to make both openssl and glad compiled with -fPIC, so it should solve both issues.

I've also added it to zlib as I assume the problem would have been the same. Please let me know if this works for you in a fresh build!

from botcraft.

maxsupermanhd avatar maxsupermanhd commented on September 21, 2024

... Aaand I was wrong, ImGui has same problem... I guess we better just slap it everywhere

from botcraft.

adepierre avatar adepierre commented on September 21, 2024

Obviously I thought about zlib but not imgui 😑

Wait for it

from botcraft.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.