Compliling projects on Linux (linking problems)


I have installed juce library, the library files are in /usr/lib but when i try too compile a program with gcc i get a lot of linking errors. :frowning:

For example if i try too compile the hello world program i get this:

src$ gcc -L/usr/lib -D "LINUX=1" -lfreetype -lpthread -lX11 -ljuce Main.cpp -o HelloWorld

Main.cpp:(.text+0x1d): undefined reference to `operator new(unsigned int)'
Main.cpp:(.text+0x49): undefined reference to `juce::JUCEApplication::main(int, char**, juce::JUCEApplication*)'
Main.cpp:(.text+0x5f): undefined reference to `operator delete(void*)'
/tmp/ccXxJmSs.o: In function `JUCEHelloWorldApplication::JUCEHelloWorldApplication()':
Main.cpp:(.text._ZN25JUCEHelloWorldApplicationC1Ev[JUCEHelloWorldApplication::JUCEHelloWorldApplication()]+0xe): undefined reference to `juce::JUCEApplication::JUCEApplication()'
Main.cpp:(.text._ZN25JUCEHelloWorldApplicationC1Ev[JUCEHelloWorldApplication::JUCEHelloWorldApplication()]+0x30): undefined reference to `juce::ShinyLookAndFeel::ShinyLookAndFeel()'
Main.cpp:(.text._ZN25JUCEHelloWorldApplicationC1Ev[JUCEHelloWorldApplication::JUCEHelloWorldApplication()]+0x43): undefined reference to `juce::JUCEApplication::~JUCEApplication()'
/tmp/ccXxJmSs.o: In function `JUCEHelloWorldApplication::getApplicationVersion()':
Main.cpp:(.text._ZN25JUCEHelloWorldApplication21getApplicationVersionEv[JUCEHelloWorldApplication::getApplicationVersion()]+0x18): undefined reference to `juce::String::String(wchar_t const*)'

and so on for a couple of pages…anyone got any ideas whats wrong? i mean i can compile the demo programs!

//apus apus


it’s clearly not linking to the juce lib at all. Not sure why, though I tend not to put the libs in usr/libs - maybe that’s got something to do with it?