Strange linker errors


#1

Hi

I am new to juce, and have gotten the Linux library to compile successfully(whew!) to juce/Builds/Linux/build/libjucedebug.a . when I compile a small program with

gcc -o jucetest jucetest.cpp -pthread -lfreetype -lX11 -lXinerama -ldl -L"juce/Builds/Linux/build" -ljucedebug

I get a linker error:

/usr/bin/ld: juce/Builds/Linux/build//libjucedebug.a(juce_linux_NativeCode_b464a4a9.o): undefined reference to symbol 'XShmGetEventBase'
/usr/bin/ld: note: 'XShmGetEventBase' is defined in DSO /usr/lib/libXext.so.6 so try adding it to the linker command line
/usr/lib/libXext.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status

when I try to fix it with -lXext, at least a thousand lines are spat out, of which the last few lines are like:

.
.
.
juce/Builds/Linux/build//libjucedebug.a(juce_AudioFormat_6605d0f9.o):(.rodata._ZTVN4juce11AudioFormatE[vtable for juce::AudioFormat]+0x30): more undefined references to `__cxa_pure_virtual' follow
juce/Builds/Linux/build//libjucedebug.a(juce_AudioFormat_6605d0f9.o):(.rodata._ZTIN4juce11AudioFormatE[typeinfo for juce::AudioFormat]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
juce/Builds/Linux/build//libjucedebug.a(juce_AudioFormat_6605d0f9.o):(.eh_frame+0x4b): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

I want to use juce in my college project… peers on the net are using it flawlessly, but when I follow the exact same steps, such linker errors pop up. I am in a distressed state - please help.

thanks in advance,
Yati

PS: I am on 32-bit Fedora; kernel 2.6.35.12-90.fc14.i686


#2

I’d very much recommend NOT building the static library, and using the amalgamated or directly-included cpp method. Use the introjucer to create your project and it should all just work.


#3

Hi Jules,

Thanks for the reply, but trying to build introjucer from the sources in the juce-1.5.2 package yields the very same ld error. Do you have a Fedora rpm for the introjucer binary? On sourceforge, I could find only the exe and the dmg versions.

thanks,

Yati


#4

I had this error once, it happens when you use gcc to compile C++ stuff.
Use ‘g++’ instead, and at least this error will disappear.


#5

[quote=“yati”]Hi Jules,

Thanks for the reply, but trying to build introjucer from the sources in the juce-1.5.2 package yields the very same ld error. Do you have a Fedora rpm for the introjucer binary? On sourceforge, I could find only the exe and the dmg versions.

thanks,

Yati[/quote]

Grab the latest tip from the GIT, and if that still fails, let me know and we’ll figure out what’s wrong.