Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/bin/ld : cannot found -lSDL2_mixer_ext_Static : File not found. #72

Open
sudodebian opened this issue Oct 31, 2023 · 5 comments
Open
Assignees

Comments

@sudodebian
Copy link

Yeah sorry for making an other issues but i'm pretty sure there's an easy way to fix but i have no idea on how to do that.

SO: I've installed the SDL-Mixer-X library just for compiling a project that i am working on. Issue is that i'm getting this error.
/usr/bin/ld : ne peut pas trouver -lSDL2_mixer_ext_Static : Aucun fichier ou dossier de ce type collect2: erreur: ld a retourné le statut de sortie 1 make[2]: *** [CMakeFiles/kektech.dir/build.make:203: bin/kektech] Error 1 make[1]: *** [CMakeFiles/Makefile2:275: CMakeFiles/kektech.dir/all] Error 2

Any ideas ? thanks.

@Wohlstand
Copy link
Member

The SDL2_mixer_ext_Static is not a name of library, it's a name of CMake symbol. If you write in your code something like target_link_libraries(xxxx PRIVATE -lSDL2_mixer_ext_Static), you better write something like target_link_libraries(xxxx PRIVATE SDL2_mixer_ext_Static) in your project. Or, better, make a kind of an interface library, and link to it, then link the interface to your target of your project.

@sudodebian
Copy link
Author

sudodebian commented Oct 31, 2023

image

Well it does seem its already written so i guess i'll remove it. If not i'll do more linking.
EDIT: No. I'm gonna try to see if i could link it to an library file.

@Wohlstand
Copy link
Member

I could share you one of my code fragments that I use to link MixerX builds at my projects.

@sudodebian
Copy link
Author

Alright why not.

@Wohlstand
Copy link
Member

Hello!
Sorry for didn't responce for a long time!
Here is my big example how I link the MixerX and AudioCodecs at one of my projects: https://github.com/Wohlstand/TheXTech/blob/main/cmake/library_SDLMixerX.cmake

  • I do have the fixed list of libraries to link, and I have some kind of a formula to properly make paths to each of these libraries.
  • I assign these libraries as BUILD_BYPRODUCTS to ExternalProject thing.
  • In some cases, I make a kind of the INTERFACE library (a virtual in-cmake "library" that allows to simplify linking the same stuff to multiple other targets without code duplication), and I link everything to it.
  • Then, I link the INTERFACE library to the application of the project, and to other things when needed.

@Wohlstand Wohlstand self-assigned this Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants