Error trying to compile ofqf

• Jun 26, 2012 - 21:50

I'm trying to compile and run musescore in Eclipse, but am confronting the following problem with making ofqf. (I have been a Java programmer for a long time, and haven't done anything in C++ for some 15 years. I'm feeling as though I cannot punch my way out of a paper bag at the moment. I'm sure I'm overlooking something quite simple.)

Here is the output in the Eclipse Console window [the emphasis below is mine; a good bit of the settings are elided to make it easier to read]:


[ 0%] [ 0%] Building CXX object thirdparty/ofqf/CMakeFiles/ofqf.dir/moc_qoscserver.cxx.o
cd /Users/pf/Documents/workspace-c++/musescore_build/thirdparty/ofqf && clang++ ... -g -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.4 ...

Building CXX object thirdparty/ofqf/CMakeFiles/ofqf.dir/moc_qoscclient.cxx.o
cd /Users/pf/Documents/workspace-c++/musescore_build/thirdparty/ofqf && clang++ ... -g -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -mmacosx-version-min=10.4 ...
...
error: PCH file was compiled for the target 'x86_64-apple-macosx10.7.4' but the current translation unit is being compiled for target 'x86_64-apple-macosx10.4.0'
1 error generated.

I'm not sure where the target 'x86_64-apple-macosx10.4.0' is being set.

Thanks for any insight into the problem.


Comments

In reply to by [DELETED] 5

Thanks for the reply.

Initially I had followed the instructions you alluded to for generating an Xcode project, but ran into a problem with the Mac SDK setting which I could not resolve.

So, I switched to using Eclipse because it is what I have been using for a good number of years now, albeit for Java development. There are notes in the Musescore Developer's Handbook on using Eclispe (see Compile instructions (Ubuntu 9.10) - SVN trunk ) and I had little trouble setting up an Eclipse project using them. But since I have not been able to resolve the "PCH file" problem (the subject of my original message in this thread), I returned to using Xcode, and managed to solve the Mac SDK problem (changed the Base SDK setting in Build Settings to "Latest Mac OS X ...").

However, now when I hit the "Run" button in Xcode, I get the following error (and 433 warnings about methods which hide overloaded virtual functions) [bold emphasis mine]:


PhaseScriptExecution "CMake PostBuild Rules" build.xcode/mscore.build/Debug/package.build/Script-A6CA527995204CA0B72B5D4C.sh
cd /Users/pf/.git/repositories/MuseScore
/bin/sh -c /Users/pf/.git/repositories/MuseScore/build.xcode/mscore.build/Debug/package.build/Script-A6CA527995204CA0B72B5D4C.sh

cd /Users/pf/.git/repositories/MuseScore/build.xcode && /opt/local/bin/cpack -C Debug --config ./CPackConfig.cmake
CPack: Create package using PackageMaker
CPack: Install projects
CPack: - Install project: mscore
CPack: Create package
CPack Error: Bad file extension specified: .GPL. Currently only .rtfd, .rtf, .html, and .txt files allowed.
CPack Error: Problem copying the resource files
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: mscore
make: *** [package_buildpart_0] Error 1
Command /bin/sh failed with exit code 2

Any ideas? A google search suggests that CMake doesn't like the GPL extension. But somehow your release builds for OS X get around this. How?

Thanks.

In reply to by [DELETED] 5

Excellent. After following your instructions on schemes, I can now run Musescore from Xcode.

Thanks.

P.S. I had clicked more than a few times on the wrong part of that goofy control -- always on the "My Mac 64-bit" part, and not on the far left part. On Apple's part, it is a badly thought-out UI. There's nothing which suggests that different regions have different effects. Anyway, that's for the Xcode forums.

I have made some progress with my Eclipse setup.

I modified "flags.make" files as follows

  1. removed "-mmacosx-version-min=10.4" from CXX_FLAGS" to prevent this:

    error: PCH file was compiled for the target 'x86_64-apple-macosx10.7.4' but the current translation unit is being compiled for target 'x86_64-apple-macosx10.4.0'

    I don't know why the -mmacosx-version-min option is an issue.

  2. added -O2 to CXX_FLAGS to prevent this:

    error: the macro '__OPTIMIZE__' was defined in the PCH file but is currently undefined

    Creation of the precompiled headers uses the following command in CMakeFiles/mops2.dir/build.make:

         clang++ -x c++-header -g -O2 -DNDEBUG -DQT_NO_DEBUG -I/usr/include -o all.h.gch all.h

    so including -O2 (that's the letter "oh", not zero) in the CXX_FLAGS sort of makes sense.

  3. removed -DQT_DEBUG from CXX_DEFINES to prevent this:

    error: definition of macro 'QT_DEBUG' conflicts with an identifier used in the precompiled header

Doing so allows me to run musescore by right-clicking on the project node in Package Explorer and selecting Run as -> Local C/C++ Application.

Note that I still have not solved the "Bad file extension specified: .GPL" in Xcode, so if anyone has any ideas, I'm all ears.

Thanks.

Do you still have an unanswered question? Please log in first to post your question.