ofxCMake icon indicating copy to clipboard operation
ofxCMake copied to clipboard

cmake config fails on ubuntu

Open davidgodzsak opened this issue 8 years ago • 3 comments

When I compile the project generated with projectGenerator using make it works just fine. But when I add the CMakeLists.txt and compile it based on the description of this project I get this error, I also get this error when I build it with CLion:

[ 95%] Linking CXX shared library ../bin/first1.app/Contents/Frameworks/libopenFrameworks.so
[ 95%] Built target static
/usr/bin/ld: /home/david/projects/OF/libs/poco/lib/linux64/libPocoFoundation.a(Thread.o): relocation R_X86_64_PC32 against symbol `_ZN4Poco10ThreadImpl20_currentThreadHolderE' 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
CMakeFiles/of_shared.dir/build.make:222: recipe for target '../bin/first1.app/Contents/Frameworks/libopenFrameworks.so' failed
make[2]: *** [../bin/first1.app/Contents/Frameworks/libopenFrameworks.so] Error 1
CMakeFiles/Makefile2:178: recipe for target 'CMakeFiles/of_shared.dir/all' failed
make[1]: *** [CMakeFiles/of_shared.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

What is wrong? How can I make it work?

I am using CLion 2017.1.3 and OpenFrameworks 0.9.8

davidgodzsak avatar Jun 21 '17 22:06 davidgodzsak

I also have this issue. Any clues how to solve it ?

nmarchais avatar Dec 05 '17 03:12 nmarchais

I have similar issues. I used projectGenerator and followed all the instructions, but it fails to build when almost completed. I hope there is still someone active on this project, I don't want to find a new IDE only to be able to run OF. I'm using CLion 2017.2.2 on Linux Mint 18.2 and OpenFrameworks 0.9.8.

[ 94%] Built target core [ 95%] Linking CXX shared library ../bin/oF_project.app/Contents/Frameworks/libopenFrameworksShared.so /usr/bin/ld : ne peut trouver -lmpg123 collect2: error: ld returned 1 exit status CMakeFiles/of_shared.dir/build.make:222 : la recette pour la cible « ../bin/oF_project.app/Contents/Frameworks/libopenFrameworksShared.so » a échouée make[3]: *** [../bin/oF_project.app/Contents/Frameworks/libopenFrameworksShared.so] Erreur 1 CMakeFiles/Makefile2:104 : la recette pour la cible « CMakeFiles/of_shared.dir/all » a échouée make[2]: *** [CMakeFiles/of_shared.dir/all] Erreur 2 CMakeFiles/Makefile2:79 : la recette pour la cible « CMakeFiles/oF_project.dir/rule » a échouée make[1]: *** [CMakeFiles/oF_project.dir/rule] Erreur 2 Makefile:164 : la recette pour la cible « oF_project » a échouée make: *** [oF_project] Erreur 2

ragri8 avatar Jan 25 '18 20:01 ragri8

I think i have the same problem... /opt/clion-2018.2.2/bin/cmake/linux/bin/cmake --build /home/rony/CLionProjects/FirstProgram/cmake-build-debug --target FirstProgram -- -j 2 -- Configuring done -- Generating done -- Build files have been written to: /home/rony/CLionProjects/FirstProgram/cmake-build-debug [ 50%] Linking C executable FirstProgram CMakeFiles/FirstProgram.dir/main.c.o: In function main': /home/rony/CLionProjects/FirstProgram/main.c:5: undefined reference to grprintf' collect2: error: ld returned 1 exit status CMakeFiles/FirstProgram.dir/build.make:83: recipe for target 'FirstProgram' failed make[3]: *** [FirstProgram] Error 1 CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/FirstProgram.dir/all' failed make[2]: *** [CMakeFiles/FirstProgram.dir/all] Error 2 CMakeFiles/Makefile2:84: recipe for target 'CMakeFiles/FirstProgram.dir/rule' failed make[1]: *** [CMakeFiles/FirstProgram.dir/rule] Error 2 Makefile:118: recipe for target 'FirstProgram' failed make: *** [FirstProgram] Error 2

ghost avatar Sep 04 '18 11:09 ghost