Hi there,
I am trying to build, compile, and run the first OpenSIm example. I am following this instructions: https://simtk-confluence.stanford.edu/p ... d=29165309
However when I try to build it using cmake (version 3.17.0), and compile using Xcode (version 11.3.1) I get the following error:
If I try to specify the compiler I get this error:
If I try t compile using Unix MakeFiles, I get this warning:
Not sure what I doing wrong, but I am certainly forgetting to do something!
Many thanks for your help.
Cheers
Dario
Build a C++ example using XCode
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
- Christopher Dembia
- Posts: 506
- Joined: Fri Oct 12, 2012 4:09 pm
Re: Build a C++ example using XCode
Dario, maybe you could proceed with Unix Makefiles, because that generated only a warning, which you can hopefully ignore.
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
Re: Build a C++ example using XCode
Hi Chris,
I managed to resolve the compiler error when using Xcode by typing this:
Apparently it is something you need to do after using homebrew.
However I now face another error in Xcode:
This is because ...SDKs/MacOSX10.14.sdk/... should be ...SDKs/MacOSX10.15.sdk/...
Not sure how to change this though.
Hope it helps.
Cheers
Dario
I managed to resolve the compiler error when using Xcode by typing this:
Code: Select all
sudo xcode-select --reset
However I now face another error in Xcode:
Code: Select all
clang: error: no such file or directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework'
Not sure how to change this though.
Hope it helps.
Cheers
Dario
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Build a C++ example using XCode
Hi Dario,
Check the CMake variable CMake_OSX_SYSROOT
and let us know,
-Ayman
Check the CMake variable CMake_OSX_SYSROOT
and let us know,
-Ayman
- Dario Cazzola
- Posts: 44
- Joined: Mon Jun 03, 2013 8:08 am
Re: Build a C++ example using XCode
Hi Ayman,
Thanks for this. I did check that variable and it refers to the right path.
However I have noticed that the file XCODE_DEPEND_HELPER.make still includes the old path (i.e. MACOS_10.14.sdk).
Thanks for your help.
Dario
Thanks for this. I did check that variable and it refers to the right path.
However I have noticed that the file XCODE_DEPEND_HELPER.make still includes the old path (i.e. MACOS_10.14.sdk).
Code: Select all
# DO NOT EDIT
# This makefile makes sure all linkable targets are
# up-to-date with anything they link to
default:
echo "Do not invoke directly"
# Rules to remove targets that are older than anything to which they
# link. This forces Xcode to relink the targets from scratch. It
# does not seem to check these dependencies itself.
PostBuild.exampleMain.Debug:
/Users/dc547/Documents/OpenSim/4.0/Code/CPP/ExampleMain/build/Debug/exampleMain:\
/Applications/OpenSim\ 4.0/sdk/lib/libosimTools.dylib\
/Applications/OpenSim\ 4.0/sdk/lib/libosimAnalyses.dylib\
/Applications/OpenSim\ 4.0/sdk/lib/libosimActuators.dylib\
/Applications/OpenSim\ 4.0/sdk/lib/libosimSimulation.dylib\
/Applications/OpenSim\ 4.0/sdk/lib/libosimCommon.dylib\
/Applications/OpenSim\ 4.0/sdk/Simbody/lib/libSimTKsimbody.3.6.dylib\
/Applications/OpenSim\ 4.0/sdk/Simbody/lib/libSimTKmath.3.6.dylib\
/Applications/OpenSim\ 4.0/sdk/Simbody/lib/libSimTKcommon.3.6.dylib\
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Accelerate.framework\
/Applications/OpenSim\ 4.0/sdk/lib/libosimLepton.dylib
/bin/rm -f /Users/dc547/Documents/OpenSim/4.0/Code/CPP/ExampleMain/build/Debug/exampleMain
Dario
- Ayman Habib
- Posts: 2248
- Joined: Fri Apr 01, 2005 12:24 pm
Re: Build a C++ example using XCode
Hi Dario,
You may need to delete the cache and rerun CMake to get a fresh XCODE_DEPEND_HELPER.cmake though I found online help that suggested this file is not used anymore (since XCode 5). Not sure since we typically do not use XCode to build on OSX.
Please let me know how it goes,
-Ayman
You may need to delete the cache and rerun CMake to get a fresh XCODE_DEPEND_HELPER.cmake though I found online help that suggested this file is not used anymore (since XCode 5). Not sure since we typically do not use XCode to build on OSX.
Please let me know how it goes,
-Ayman
- Hendrik Reimann
- Posts: 5
- Joined: Tue Apr 07, 2015 1:54 pm
Re: Build a C++ example using XCode
I had the same issue and spent a very frustrating weekend trying to solve it, so putting this here for others.
My problem was that I had an older standard install of OpenSim in the usual place (Applications/OpenSim...), which I had installed a while ago, and I had updated the OS in the meantime. When generating the XCode project, CMake used this pre-installed version of OpenSim, rather than the newer version I had built from source code more recently, and the linker complained with the above error. Pointing CMake to the right locations fixed it:
My problem was that I had an older standard install of OpenSim in the usual place (Applications/OpenSim...), which I had installed a while ago, and I had updated the OS in the meantime. When generating the XCode project, CMake used this pre-installed version of OpenSim, rather than the newer version I had built from source code more recently, and the linker complained with the above error. Pointing CMake to the right locations fixed it: