How to make a xcode project without projucer?


I’m trying to make my own xcode project and include all the juce stuff, so I can use those juce classes in my OSX app.

However, I’m getting stuck at every step along the way it seems. Errors all over the place. The last one I am getting (I feel like Im getting close to using juce now), is:

Undefined symbols for architecture x86_64:
“juce::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode::this_will_fail_to_link_if_some_of_your_compile_units_are_built_in_release_mode()”, referenced from:
___cxx_global_var_init in JuceTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea as to why this might happen?

Also, I notice in the xcode projects built with the projucer, that the JuceLibraryCode folder and the JuceModules folders have been added. Any idea whether these are needed and how to add them properly? I also notice that some of the files inside the JuceLibraryCode do not appear in the BuildPhases>CompileSources section (only the mm files from JuceModules) Any idea why this is the case?

Is there any definitive way, or tutorial on including Juce inside your own application. I can’t seem to find information on this anywhere. There is a forum post that mentions using a static library, and including “include JuceHeader.h” but that didnt work for me at all (xcode completely ignores the library altogether - built in universal 32/64 mode.

The best way to setup XCode is to startup projucer, setup a new project and comparing the xcode settings to your project.
Also have a look at the some additional files that include juce defines and settings, libraries and maybe also some cpp files that projucer adds to the project.

1 Like

This means that some of your object files were compiled with DEBUG=1 NDEBUG=0, and others with DEBUG=0 NDEBUG=1 (or some permutation of the two).

You don’t need to add the JUCE modules to the project to get things to compile, but it’s nice if you’re going to browse the code.

The .mm files are mostly duplicates of the corresponding .cpp files and the .mm extension means that we can use OS X Objective-C functions (via Objective-C++).

What do you mean by “xcode completely ignores the library altogether”? Do you see it in the linker command of your build process?