Problems using JUCE in Ubuntu 13.04


#1

Installed Ubuntu 13.04 in a VM today and started playing with it.

Looks like the new version of gnu g++ is picking out 2 warnings:

In file included from JuceLibraryCode/modules/juce_core/juce_core.cpp:186:0: juce_linux_Threads.cpp: In static member function ‘static void juce::Process::lowerPrivilege()’: juce_linux_Threads.cpp:95:39: warning: ignoring return value of ‘int setreuid(__uid_t, __uid_t)’, declared with attribute warn_unused_result [-Wunused-result] juce_linux_Threads.cpp:96:39: warning: ignoring return value of ‘int setregid(__gid_t, __gid_t)’, declared with attribute warn_unused_result [-Wunused-result] juce_linux_Threads.cpp: In static member function ‘static void juce::Process::raisePrivilege()’: juce_linux_Threads.cpp:85:39: warning: ignoring return value of ‘int setreuid(__uid_t, __uid_t)’, declared with attribute warn_unused_result [-Wunused-result] juce_linux_Threads.cpp:86:39: warning: ignoring return value of ‘int setregid(__gid_t, __gid_t)’, declared with attribute warn_unused_result [-Wunused-result]

The next issue I ran into is a problem at link time. However, this is the first time I’ve tried to compile any of my small JUCE test apps in a 32-bit VM versus the 64-bit VMs I typically use, so I’m still digging into this error as I may have missed something important:

/usr/bin/ld: CMakeFiles/test.dir/__/JuceLibraryCode/modules/juce_core/juce_core.cpp.o: undefined reference to symbol 'dladdr@@GLIBC_2.0' /usr/bin/ld: note: 'dladdr@@GLIBC_2.0' is defined in DSO /lib/i386-linux-gnu/libdl.so.2 so try adding it to the linker command line /lib/i386-linux-gnu/libdl.so.2: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[2]: *** [src/test] Error 1 make[1]: *** [src/CMakeFiles/test.dir/all] Error 2 make: *** [all] Error 2


#2

Nevermind the link time error about dladdr@@GLIBC_2.0. Added the following to my CMakeLists.txt and it fixed everything up:

FIND_LIBRARY ( DL dl )

TARGET_LINK_LIBRARIES ( … ${DL} … )

Not sure if I never ran into this before now due to a 32-bit/64-bit difference, or if this is now required where in the past it wasn’t, but as far as I can tell all my small JUCE apps I’ve written are working fine in Ubuntu 13.04.


#3

Thanks, I’ll tidy up those warnings.

So this is your own makefile, not something the introjucer created, right?


#4

Correct, this is using CMake.


#5

Ok, ta.


#6

Hi StephaneCharette,
I would love to take a look at your CMakeLists.txt file, if you are willing to share it! I think it would be a great reference for anyone trying to build JUCE with CMake. Thanks!
-Jonathan


#7

You know what, I’ll start a new thread to describe how I use CMake. I’m guessing it could be useful to other people.