Closed MiladAlshomary closed 7 years ago
It seems you are using the CMake script to build the project.
If you know the exact location of your library mpg123.a
, try modify the link libraries (see https://github.com/damellis/ESP/blob/master/CMakeLists.txt#L174) to include the path to the library. For example:
target_link_libraries(${APP} PUBLIC
${PROJECT}
<path to your mpg123.a>
)
Alternatively, the project configures libraries in an OS-dependent way. For *nix, we configure SYS_LIBS
variable here: https://github.com/damellis/ESP/blob/master/CMakeLists.txt#L139. Snippet replicated below:
set(SYS_LIBS "-L/usr/local/lib -lblas")
You may add the path to SYS_LIBS
.
I don't have a Fedora to test, but if you have some luck, PR is welcome!
@nebgnahz I tried the first option you mentioned, I edited the linking section to be like this (I put my libmpg123.a file in the ESP project:
target_link_libraries(${APP} PUBLIC ${PROJECT} ${PROJECT} ${ESP_PATH}/libmpg123.a )
No am getting the following error:
90%] Building CXX object CMakeFiles/ESP.dir/Xcode/ESP/src/tuneable.cpp.o [ 92%] Building CXX object CMakeFiles/ESP.dir/Xcode/ESP/src/main.cpp.o [ 95%] Linking CXX static library libesp.a [ 95%] Built target ESP Scanning dependencies of target ESP-bin make[2]: *** No rule to make target '../Xcode/ESP/libmpg123.a', needed by 'ESP'. Stop. make[2]: *** Waiting for unfinished jobs.... [ 97%] Building CXX object CMakeFiles/ESP-bin.dir/Xcode/ESP/src/user.cpp.o CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ESP-bin.dir/all' failed make[1]: *** [CMakeFiles/ESP-bin.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
Any help please about what is going on?
==== Edited:
I managed to get it working finally, As you mentioned I linked to the following library /usr/local/lib/libmpg123.so
Thanks
Hello all, I managed to build mostly everything for the project on my linux fedora system. The last build of the project I got a series of errors regarding mpg123, std::allocator >, std::vector<short, std::allocator >&, std::vector<float, std::allocator >&)':
ofOpenALSoundPlayer.cpp:(.text+0x194a): undefined reference to
[ 2%] Linking CXX static library libesp.a [ 95%] Built target ESP [ 97%] Linking CXX executable ESP ../third-party/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofOpenALSoundPlayer.o): In function
ofOpenALSoundPlayer::initialize()': ofOpenALSoundPlayer.cpp:(.text+0xfb4): undefined reference tompg123_init' ../third-party/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofOpenALSoundPlayer.o): In function
ofOpenALSoundPlayer::close()': ofOpenALSoundPlayer.cpp:(.text+0x10fb): undefined reference tompg123_exit' ../third-party/openFrameworks/libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofOpenALSoundPlayer.o): In function
ofOpenALSoundPlayer::mpg123ReadFile(std::__cxx11::basic_string<char, std::char_traitsmpg123_new' ofOpenALSoundPlayer.cpp:(.text+0x196f): undefined reference to
mpg123_open' ofOpenALSoundPlayer.cpp:(.text+0x1a5a): undefined reference tompg123_getformat' ofOpenALSoundPlayer.cpp:(.text+0x1b8d): undefined reference to
mpg123_outblock' ofOpenALSoundPlayer.cpp:(.text+0x1bf5): undefined reference tompg123_read' ofOpenALSoundPlayer.cpp:(.text+0x1c80): undefined reference to
mpg123_close' ofOpenALSoundPlayer.cpp:(.text+0x1c8c): undefined reference tompg123_delete' .........
I checked mpg123 and its installed on my system. After long search about this issue I found that I need to link the mpg123.a library statically. Any idea on how to do this?
Thanks!!