Linker error building a new GUI program


#1

I am working on a GUI program and am using the IntroJucer to build it. I am working on the tip and Xcode 3.2.5 64 bits.

In Introjucer I select new Program (file menu). I select GUI application and the correct Juce directory. I add a new folder on the next page. I choose a projectname and a main plus window option. I save the project and open it in Xcode using the option in Introjucer.

I start the debug build in Xcode and the the next linker error messages:

[quote]Ld /gereed/Debug/Serialmaker.app/Contents/MacOS/Serialmaker normal i386
cd /serialmaker/Builds/MacOSX
/Developer/usr/bin/g+±4.2 -arch i386 -L/gereed/Debug -F/gereed/Debug -filelist /gereed/Serialmaker.build/Debug/Serialmaker.build/Objects-normal/i386/Serialmaker.LinkFileList -framework Cocoa -framework Carbon -framework IOKit -framework CoreAudio -framework CoreMIDI -framework WebKit -framework DiscRecording -framework OpenGL -framework QuartzCore -framework QTKit -framework QuickTime -o /gereed/Debug/Serialmaker.app/Contents/MacOS/Serialmaker

Undefined symbols:
"_AudioFileGetGlobalInfo", referenced from:
juce::(anonymous namespace)::findFileExtensionsForCoreAudioCodecs()in JuceLibraryCode4.o
"_ExtAudioFileDispose", referenced from:
juce::CoreAudioReader::~CoreAudioReader()in JuceLibraryCode4.o
juce::CoreAudioReader::~CoreAudioReader()in JuceLibraryCode4.o
"_ExtAudioFileRead", referenced from:
juce::CoreAudioReader::readSamples(int**, int, int, long long, int)in JuceLibraryCode4.o
"_ExtAudioFileSeek", referenced from:
juce::CoreAudioReader::readSamples(int**, int, int, long long, int)in JuceLibraryCode4.o
"_AudioFileOpenWithCallbacks", referenced from:
juce::CoreAudioReader::CoreAudioReader(juce::InputStream*)in JuceLibraryCode4.o
"_ExtAudioFileWrapAudioFileID", referenced from:
juce::CoreAudioReader::CoreAudioReader(juce::InputStream*)in JuceLibraryCode4.o
"_ExtAudioFileSetProperty", referenced from:
juce::CoreAudioReader::CoreAudioReader(juce::InputStream*)in JuceLibraryCode4.o
"_ExtAudioFileGetProperty", referenced from:
juce::CoreAudioReader::CoreAudioReader(juce::InputStream*)in JuceLibraryCode4.o
juce::CoreAudioReader::CoreAudioReader(juce::InputStream*)in JuceLibraryCode4.o
"_AudioFileClose", referenced from:
juce::CoreAudioReader::~CoreAudioReader()in JuceLibraryCode4.o
juce::CoreAudioReader::~CoreAudioReader()in JuceLibraryCode4.o
ld: symbol(s) not found
collect2: ld returned 1 exit status[/quote]

What am I doing wrong? I added the CoreAudio and CoreAudioKit framework in another thread someone wrote about, but this did not solve it.


#2

Try AudioToolbox.framework.

You can figure this stuff out for yourself, you know - if you look-up the missing functions in the apple docs, it’ll tell you exactly which framework they’re from!


#3

Great! Thanks for the tip :slight_smile:


#4

I too was getting this error and have now resolved it (I think).

I do have a couple of questions/points

I am completely new to Mac development (20+ years on PC’s) and maybe naively thought if I created a starter project with IntroJucer it would just work. All configurations of how to include juce in the Application (GUI) project type failed to compile successfully for various reasons each different. I did manage to get a version to compile after reading this thread. I want to use the Juce amalgamated files.

Are these errors just linked to Xcode 4 and not needed in Xcode 3? If so might it be useful in IntroJucer to have an option to specify the version of Xcode like you do for the various versions of Visual Studio. Or even add the frameworks if certain Juce options selected although in my case I disabled all sound/hardware specific options as simply want to use juce as a cross platform GUI.

I realise I am going to have learn my way around Xcode but had hoped to get a head start or even delay it by using IntoJucer.

Daniel


#5

That’s not naive at all - that’s exactly what’s supposed to happen… And I use the introjucer to generate all my projects with no problem - if something didn’t work for you, it’s probably a bug, so let me know.

The problem in this thread wasn’t because the introjucer was failing, it’s just because I’d updated the code in the last couple of weeks to require another framework, so you’d also need to build the latest version of the introjucer for it to handle that - I don’t think the pre-compiled version is up-to-date enough.