Linking problem on mac


#1

Xcode has a trouble in linking, which I can’t explain:

Checking Dependencies Ld /Developer/Projects/Debug/juce_application.app/Contents/MacOS/juce_application normal i386 cd "/Volumes/JUCE/extras/audio plugins/On The Road/build/Standalone_Mac" /usr/bin/g++-4.0 -o /Developer/Projects/Debug/juce_application.app/Contents/MacOS/juce_application -L/Developer/Projects/Debug -L../../../../../bin -F/Developer/Projects/Debug -F../../../../../bin -filelist /Developer/Build\ Files/juce_application.build/Debug/juce_application.build/Objects-normal/i386/juce_application.LinkFileList -framework Carbon -framework CoreAudio -framework AGL -framework QuickTime -framework IOKit -arch i386 -Wl,-Y,1455 /usr/bin/ld: Undefined symbols: juce::MidiBuffer::MidiBuffer() juce::MidiBuffer::~MidiBuffer() juce::TextButton::changeWidthToFitText(int) ... goes on with basically all juce classes

I made sure to link to the debug library, and I specified the direct path to juce library : /Volumes/JUCE/bin into the “Library Search Paths” field.

I don’t know where to look at to solve this problem , someone has an idea ?

Thanks,

Nicolas


#2

It doesn’t look like the linker actually has anything in there to tell it to link to the juce lib. Double-check inside your target settings that it’s in the list of objects to use during the link step.


#3

yes, libjucedebug is inside the list of object,

I actually went back to JUCEHelloworldApplication (which compiles fine), and made a step by step…

So here are 2 lines added to JUCEHelloworldApplication (in blue) which gives me the linking error :


class JUCEHelloWorldApplication : public JUCEApplication
{
HelloWorldWindow* helloWorldWindow;
[color=blue]AudioDeviceManager *audioDeviceManager;[/color]
public:
JUCEHelloWorldApplication()
: helloWorldWindow (0)
{
}

~JUCEHelloWorldApplication()
{
}

void initialise (const String& commandLine)
{
[color=blue]audioDeviceManager=new AudioDeviceManager();[/color]
helloWorldWindow = new HelloWorldWindow();
}
(…)

build:

[quote]Ld /Developer/Projects/Debug/juce_application.app/Contents/MacOS/juce_application normal i386
cd “/Volumes/JUCE/extras/example projects/example_project_for_Mac”
/usr/bin/g+±4.0 -o /Developer/Projects/Debug/juce_application.app/Contents/MacOS/juce_application -L/Developer/Projects/Debug -L…/…/juce/bin -F/Developer/Projects/Debug -filelist /Developer/Build\ Files/juce_application.build/Debug/juce_application.build/Objects-normal/i386/juce_application.LinkFileList /Volumes/JUCE/bin/libjucedebug.a -framework Carbon -framework CoreAudio -framework AGL -framework QuickTime -framework IOKit -arch i386 -Wl,-Y,1455
/usr/bin/ld: warning -L: directory name (…/…/juce/bin) does not exist
/usr/bin/ld: Undefined symbols:
_MIDIClientCreate
_MIDIDeviceGetNumberOfEntities
_MIDIEndpointGetEntity
_MIDIEntityGetDevice
_MIDIGetDestination
…[/quote]

I also tried in win32 and this compiled fine.

Any idea ?


#4

Oh, well if you’re missing stuff like MIDIClientCreate, then all you need to do is add some apple frameworks to your project - in this case, I guess you need the CoreMidi framework.


#5

Thanks Jules, for some reason I was thinking this was a juce linking problem… even if there was no ‘juce’ in there … doh

Problem solved…

Nicolas