I created a Juce project (on Windows) for a mixer application that I’m trying to build. The project builds fine on Windows (in MS Visual C++ 19).
I then did the following:
Downloaded the (latest) Juce library to my Mac.
I copied all source files over to a Mac (using a USB stick).
I updated the Juce project (Projucer) file to the new Mac directory paths.
I then tried building the project using Xcode, but I get the following build error:
< command line >
Macro name must be an identifier
(!) In file included from <built-in>:403:
There is no other error information, and if I double click on the error, Xcode doesn’t should me any source file.
I suspect one of the preprocessor definitions isn’t being escaped properly. Is the ‘Use Global AppConfig header’ option in the Projucer enabled or disabled? If it’s disabled, try enabling it and see whether that fixes the build.
If enabling the global AppConfig header fixes the problem, it would be helpful if you could post the generated AppConfig.h so that we can try to work out exactly what’s causing the issue.
The “Use Global App Config” setting was already enabled. (It was the default) I trued disabling it, but it didn’t help.
I also tried going to the “Modules” section of the project and verifying the paths of all modules. In addition, I tried using the “Use Global Path For All Modules” option, but also no help.
As a test, I tried building the “Audio Plugin Host” demo application on Mac, and that built OK.
Any other suggestions???
Try reopening the jucer project on your Mac, then click on the XCode icon. This will save everything once again and open XCode. Build from here.
I have tried that many times. No luck.
I have also tried removing all of the preprocessor definitions that I had in the Projucer project file. That didn’t help either.
Open to other suggestions that I could try.
Can you share the build command that causes the error? There are instructions to see the build log in this post (or in this stack overflow answer). Hopefully that will show us the troublesome definition, and then we can try to work out where it’s coming from.
After a LOT of experimentation (looking into app parameters of the Juce Projucer project file), I was not able to find any issues that would explain the “command line” error that I was getting, or get it to go away.
I ended up re-creating the Juce Projucer project file on Mac (using a different folder and project name), and that resolved it. I was then able to copy that project file over to my Windows system, and it built there as well.
I am left with the belief that Juce projects can be created on Mac and then moved to Windows, but not the reverse. This seems like a big issue to me!
I have been building cross-platform projects using JUCE for years, with most of my projects originating on Windows, and then simply pulling the code on to my Mac, generating the xcode project, and building, with no issues. Obviously you have run into an issue, but the issue isn’t a generic one as your statement indicates.
Hummm… Perhaps, it has worked for others. But as I mentioned, the Juce project that I created on Windows would build on Windows but would not build on Mac. When I created a new project using the Mac version of Projucer, it built fine on both Windows and Mac. There’s a bug there somewhere.
More annoying was the fact the Max Xcode compiler would not give me any real info about the build error. It just said it was a " error". (I always find the Mac stuff to be more of a headache!)
Did you try my suggestion to view the full build output? If you share that here, perhaps one of us will be able to spot what’s going wrong.
How do I “view the full build output” on Mac?
There are some links to guides in my earlier post.