Undefined references (sorry, fixed now)


#1

I’ve got a feeling I’m missing something obvious here, but I can’t seem to link to libjuce. I’m using autoconf, but I don’t see anything missing on the g++ calls it generates. I think the problem’s probably down to the fact that I’ve just switched to using Anjuta v2, which handles the autoconf stuff slightly differently to its predecessor. I’ve also just upgraded to ubuntu 7.04, which could have something to do with it (though Twindy still compiles fine). I’d be grateful if someone could help me out.

Here’s the command line output (it’s just the start of a project, hence it’s just one file I’m trying to compile):

niall@ubuntu:~/Projects/FourTrack$ make
make  all-recursive
make[1]: Entering directory `/home/niall/Projects/FourTrack'
Making all in src
make[2]: Entering directory `/home/niall/Projects/FourTrack/src'
if g++ -DHAVE_CONFIG_H -I. -I. -I..  -DPACKAGE_LOCALE_DIR=\""/usr/local//locale"\" -DPACKAGE_SRC_DIR=\""."\" -DPACKAGE_DATA_DIR=\""/usr/local/share"\"    -DRelease -DLINUX -Wall -O3 -g -O2 -I/usr/include/freetype2 -I../../juce -MT main.o -MD -MP -MF ".deps/main.Tpo" -c -o main.o main.cpp; \
        then mv -f ".deps/main.Tpo" ".deps/main.Po"; else rm -f ".deps/main.Tpo"; exit 1; fi
g++ -DRelease -DLINUX -Wall -O3 -g -O2 -I/usr/include/freetype2 -I../../juce  -L../../juce/bin -ljuce -o fourtrack  main.o -lX11 -lXpm -lXext -lSM -lICE   -ljack -lpthread -lfreetype -lz 
main.o: In function `App':
/home/niall/Projects/FourTrack/src/main.h:32: undefined reference to `juce::JUCEApplication::JUCEApplication()'
main.o: In function `main':
/home/niall/Projects/FourTrack/src/main.cpp:71: undefined reference to `juce::JUCEApplication::main(int, char**, juce::JUCEApplication*)'
main.o: In function `~DerivedWindow':
/home/niall/Projects/FourTrack/src/main.cpp:63: undefined reference to `juce::DocumentWindow::~DocumentWindow()'
main.o: In function `DerivedWindow':
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::String(wchar_t const*)'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::Colours::white'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::DocumentWindow::DocumentWindow(juce::String const&, juce::Colour const&, int, bool)'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::~String()'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::~String()'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::String(wchar_t const*)'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::Colours::white'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::DocumentWindow::DocumentWindow(juce::String const&, juce::Colour const&, int, bool)'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::~String()'
/home/niall/Projects/FourTrack/src/main.cpp:53: undefined reference to `juce::String::~String()'
main.o: In function `App::initialise(juce::String const&)':
/home/niall/Projects/FourTrack/src/main.cpp:31: undefined reference to `juce::ApplicationCommandManager::ApplicationCommandManager()'
/home/niall/Projects/FourTrack/src/main.cpp:37: undefined reference to `juce::Component::centreWithSize(int, int)'
main.o: In function `DerivedWindow::closeButtonPressed()':
/home/niall/Projects/FourTrack/src/main.cpp:68: undefined reference to `juce::JUCEApplication::quit(bool)'
main.o: In function `~DerivedWindow':
/home/niall/Projects/FourTrack/src/main.cpp:63: undefined reference to `juce::DocumentWindow::~DocumentWindow()'
/home/niall/Projects/FourTrack/src/main.cpp:63: undefined reference to `juce::DocumentWindow::~DocumentWindow()'
main.o: In function `App::initialise(juce::String const&)':
/home/niall/Projects/FourTrack/src/main.cpp:39: undefined reference to `juce::TopLevelWindow::setUsingNativeTitleBar(bool)'
main.o: In function `App::getApplicationVersion()':
/home/niall/Projects/FourTrack/src/main.h:44: undefined reference to `juce::String::String(wchar_t const*)'
main.o: In function `App::getApplicationName()':
/home/niall/Projects/FourTrack/src/main.h:42: undefined reference to `juce::String::String(wchar_t const*)'
main.o: In function `~App':
/home/niall/Projects/FourTrack/src/main.h:34: undefined reference to `juce::JUCEApplication::~JUCEApplication()'
/home/niall/Projects/FourTrack/src/main.h:34: undefined reference to `juce::JUCEApplication::~JUCEApplication()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x10): undefined reference to `juce::Component::mouseMove(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x14): undefined reference to `juce::Component::mouseEnter(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x18): undefined reference to `juce::Component::mouseExit(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x1c): undefined reference to `juce::ResizableWindow::mouseDown(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x20): undefined reference to `juce::ResizableWindow::mouseDrag(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x24): undefined reference to `juce::Component::mouseUp(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x28): undefined reference to `juce::DocumentWindow::mouseDoubleClick(juce::MouseEvent const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x2c): undefined reference to `juce::Component::mouseWheelMove(juce::MouseEvent const&, float, float)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x34): undefined reference to `juce::DocumentWindow::setName(juce::String const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x38): undefined reference to `juce::Component::setVisible(bool)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x3c): undefined reference to `juce::ResizableWindow::visibilityChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x40): undefined reference to `juce::TopLevelWindow::addToDesktop(int, void*)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x44): undefined reference to `juce::DocumentWindow::userTriedToCloseWindow()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x48): undefined reference to `juce::Component::minimisationStateChanged(bool)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x4c): undefined reference to `juce::TopLevelWindow::parentHierarchyChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x50): undefined reference to `juce::Component::childrenChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x54): undefined reference to `juce::Component::hitTest(int, int)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x58): undefined reference to `juce::Component::contains(int, int)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x5c): undefined reference to `juce::DocumentWindow::lookAndFeelChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x60): undefined reference to `juce::Component::createFocusTraverser()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x64): undefined reference to `juce::Component::enablementChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x68): undefined reference to `juce::Component::getMouseCursor()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x6c): undefined reference to `juce::DocumentWindow::paint(juce::Graphics&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x70): undefined reference to `juce::Component::paintOverChildren(juce::Graphics&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x74): undefined reference to `juce::Component::keyPressed(juce::KeyPress const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x78): undefined reference to `juce::Component::keyStateChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x7c): undefined reference to `juce::Component::modifierKeysChanged(juce::ModifierKeys const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x80): undefined reference to `juce::Component::focusGained(juce::Component::FocusChangeType)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x84): undefined reference to `juce::Component::focusLost(juce::Component::FocusChangeType)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x88): undefined reference to `juce::TopLevelWindow::focusOfChildComponentChanged(juce::Component::FocusChangeType)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x8c): undefined reference to `juce::DocumentWindow::resized()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x90): undefined reference to `juce::ResizableWindow::moved()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x94): undefined reference to `juce::ResizableWindow::childBoundsChanged(juce::Component*)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x98): undefined reference to `juce::ResizableWindow::parentSizeChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0x9c): undefined reference to `juce::Component::broughtToFront()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xa0): undefined reference to `juce::Component::filesDropped(juce::StringArray const&, int, int)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xa4): undefined reference to `juce::Component::handleCommandMessage(int)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xa8): undefined reference to `juce::Component::canModalEventBeSentToComponent(juce::Component const*)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xac): undefined reference to `juce::Component::inputAttemptWhenModal()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xb0): undefined reference to `juce::Component::colourChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xb4): undefined reference to `juce::Component::internalRepaint(int, int, int, int)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xb8): undefined reference to `juce::Component::createNewPeer(int, void*)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xbc): undefined reference to `juce::Component::handleMessage(juce::Message const&)'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xc0): undefined reference to `juce::DocumentWindow::activeWindowStatusChanged()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xc4): undefined reference to `juce::DocumentWindow::getDesktopWindowStyleFlags() const'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xc8): undefined reference to `juce::DocumentWindow::getBorderThickness()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xcc): undefined reference to `juce::DocumentWindow::getContentComponentBorder()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xd4): undefined reference to `juce::DocumentWindow::minimiseButtonPressed()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xd8): undefined reference to `juce::DocumentWindow::maximiseButtonPressed()'
main.o:(.rodata._ZTV13DerivedWindow[vtable for DerivedWindow]+0xec): undefined reference to `non-virtual thunk to juce::Component::handleMessage(juce::Message const&)'
main.o:(.rodata._ZTV3App[vtable for App]+0x10): undefined reference to `juce::JUCEApplication::getNextCommandTarget()'
main.o:(.rodata._ZTV3App[vtable for App]+0x14): undefined reference to `juce::JUCEApplication::getAllCommands(juce::Array<int, juce::DummyCriticalSection>&)'
main.o:(.rodata._ZTV3App[vtable for App]+0x18): undefined reference to `juce::JUCEApplication::getCommandInfo(int, juce::ApplicationCommandInfo&)'
main.o:(.rodata._ZTV3App[vtable for App]+0x1c): undefined reference to `juce::JUCEApplication::perform(juce::ApplicationCommandTarget::InvocationInfo const&)'
main.o:(.rodata._ZTV3App[vtable for App]+0x38): undefined reference to `juce::JUCEApplication::systemRequestedQuit()'
main.o:(.rodata._ZTV3App[vtable for App]+0x3c): undefined reference to `juce::JUCEApplication::unhandledException(std::exception const*, juce::String const&, int)'
main.o:(.rodata._ZTI13DerivedWindow[typeinfo for DerivedWindow]+0x8): undefined reference to `typeinfo for juce::DocumentWindow'
main.o:(.rodata._ZTI3App[typeinfo for App]+0x8): undefined reference to `typeinfo for juce::JUCEApplication'
collect2: ld returned 1 exit status
make[2]: *** [fourtrack] Error 1
make[2]: Leaving directory `/home/niall/Projects/FourTrack/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/niall/Projects/FourTrack'
make: *** [all] Error 2

Thanks,

  • Niall.

#2

:oops: Sorry… I figured it out myself - I’d forgotten to add AM_PROG_LIBTOOL to my configure.in.

  • Niall.

#3