GithubHelp home page GithubHelp logo

[Termux] Linker issue about hurrican HOT 6 CLOSED

IntinteDAO avatar IntinteDAO commented on May 23, 2024
[Termux] Linker issue

from hurrican.

Comments (6)

drfiemost avatar drfiemost commented on May 23, 2024

It seems you're not linking to SDL_mixer
Hurrican can be compiled both with SDL2 (preferred) and SDL1. In any case you need the corresponding SLD_mixer and SDL_image libraries.

from hurrican.

IntinteDAO avatar IntinteDAO commented on May 23, 2024

@drfiemost

Thank you for your reply

Just doesn't Cmake manage this to automatically configure everything to link the application correctly?

While in the case of a makefile (pure) such things are a matter of Make and the appropriate linker flags, in the case of Cmake it seems to be done automatically ...?

Cmake itself finds SDL2 libraries correctly

obraz

from hurrican.

IntinteDAO avatar IntinteDAO commented on May 23, 2024

Ok, I fixed it by manually adding libs about linker to CMAKE. I wonder why it can't by default detect it on CMakeLists ...

from hurrican.

drfiemost avatar drfiemost commented on May 23, 2024

Yes, cmake should handle this automatically:

https://github.com/HurricanGame/Hurrican/blob/67da195a2fea7cb43202626a18f13357ac6adac2/Hurrican/CMakeLists.txt#L559C48-L559C48

I see you have no problems linking with SDL_image, maybe there's something wrong with the SDL_mixer cmake modules on your platform.
You can check the CMakeCache.txt file, I have this on Linux:

//Path to a file.
SDL2_MIXER_INCLUDE_DIR:PATH=/usr/include/SDL2

//Path to a library.
SDL2_MIXER_LIBRARY:FILEPATH=/usr/lib/libSDL2_mixer.so

from hurrican.

IntinteDAO avatar IntinteDAO commented on May 23, 2024

I was not able to solve this problem with your method, but I found my:

CMake Error at CMakeLists.txt:559:
  Parse error.  Expected a command name, got unquoted argument with text
  "SDL2_MIXER_INCLUDE_DIR="/data/data/com.termux/files/usr/include/SDL2"".
target_link_libraries(${PROJECT_NAME} SDL2 SDL2_image SDL2_mixer)

In short I just add to linker info about SDL.

But I think the CMake file is little broken.

else(SDL2_FOUND)

I think this else will never be executed, because if SDL2_FOUND is true in main verification, then else should not be executed I think.

I think we can close this issue if you want, because the Termux build can handle just my patch :)

from hurrican.

drfiemost avatar drfiemost commented on May 23, 2024

But I think the CMake file is little broken.

else(SDL2_FOUND)

I think this else will never be executed, because if SDL2_FOUND is true in main verification, then else should not be executed I think.

That's the (legacy) cmake syntax, if SDL2 is found the first block is executed, if not it means that SDL1 has been found (or it would have errored out) and the second block is executed.

from hurrican.

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.