Missing C++ support in Xcode9.2 for MacOS app? Topic is solved
Missing C++ support in Xcode9.2 for MacOS app?
I just fixed all installing issues of wxWidgets 3.1 on MacOS 10.12 and then found out an embarrass thing that xcode9.2 could not create native macOS app using C++ language, it's only supporting ObjectC or Swift.
Is it possible to make Xcode supporting C++ or I shall switch to any other IDEs
(unfortunatly visual studio for mac does not support C++ neigher)
Is it possible to make Xcode supporting C++ or I shall switch to any other IDEs
(unfortunatly visual studio for mac does not support C++ neigher)
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Missing C++ support in Xcode9.2 for MacOS app?
I'm using Code::Blocks under OS X 10.9 Mavericks (should work in macOS too); just installed the Xcode's command line tools without the IDE.
--
EDIT: And in case the most recent Xcode doesn't provide any C++ compiler (don't know), you can install it by yourself.
--
EDIT: And in case the most recent Xcode doesn't provide any C++ compiler (don't know), you can install it by yourself.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Missing C++ support in Xcode9.2 for MacOS app?
Coud code::blocks generate the necessary bundle file to pack a application so it can be run in lancher?eranon wrote:I'm using Code::Blocks under OS X 10.9 Mavericks (should work in macOS too); just installed the Xcode's command line tools without the IDE.
--
EDIT: And in case the most recent Xcode doesn't provide any C++ compiler (don't know), you can install it by yourself.
My task is to write cross-platform C++ project, it's mainly develop in Windows(Visual Studio) with a little adaption in Mac
I can do compile in commandline with wx-config in mac, but no idea of packing to app, it was previously done by older version of Xcode.
Re: Missing C++ support in Xcode9.2 for MacOS app?
Looks like a guide of creating a commandline c++ project, this is still supported in Xcode9.
Thans you
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Missing C++ support in Xcode9.2 for MacOS app?
Code::Blocks doesn't generate anything for you, but an app bundle is nothing more than a special directory including a normalized tree. It's not so difficult to find some documentations about the structure of an app bundle (what I did when I wanted to produce mines) and you just have to create it at post-build stage from a shell script... And, in my opinion, it's far more instructive to master every step than relaying on an obscure black box like Xcode (freedom is often a matter of knowledge).xuboying wrote:Coud code::blocks generate the necessary bundle file to pack a application so it can be run in lancher?
My task is to write cross-platform C++ project, it's mainly develop in Windows(Visual Studio) with a little adaption in Mac
I can do compile in commandline with wx-config in mac, but no idea of packing to app, it was previously done by older version of Xcode.
Well, here is one of my scripts (here called "OSX_post_build.sh") from one of my projects:
Code: Select all
#!/bin/sh
# Shopifight (c) FFh Lab - Post-build treatment
# (Eric Lequien - 2016/07/23)
if [ $# -lt 2 ]
then
echo "Usage : $0 Debug|Release BundleName [BinName]"
echo "NB1 : No BinName assumes use of lowered BundleName"
echo "NB2 : Project must be in lowered BundleName directory"
echo "EG. : $0 Debug Alify alify"
echo " to (re)create ./alify/bin/Debug/Alify.app"
exit 1
fi
export APP_NAME="${2}"
if [ "${3}" = "" ]
then
export EXE_NAME=$(echo ${2} | tr "[A-Z]" "[a-z]")
else
export EXE_NAME="${3}"
fi
export PROJECT_NAME=$(echo ${2} | tr "[A-Z]" "[a-z]")
export WORKING_DIR="./${PROJECT_NAME}/bin/${1}"
export RESOURCES_DIR="./../compo"
#export DOCS_DIR="./help"
cd "`dirname "$0"`"
if [ ! -d ${WORKING_DIR} ]
then
echo "Error : ${WORKING_DIR} does not exist"
exit 1
fi
echo "Reset eventual bundle"
if [ ! -f "${WORKING_DIR}/${EXE_NAME}" ]
then
# Build options in Codeblocks have been configured to directly build the executable in bundle tree
echo No '${WORKING_DIR}/${EXE_NAME}', so we assume binaries has been built directly in bundle tree
if [ ! -f "${WORKING_DIR}/${APP_NAME}.app/Contents/MacOS/${EXE_NAME}" ]
then
echo Neither ${WORKING_DIR}/${EXE_NAME} nor ${WORKING_DIR}/${APP_NAME}.app/Contents/MacOS/${EXE_NAME} found !
exit 1
fi
# we preserve the executable before to entirely renew the bundle (avoid to keep any eventual orphan files inside it)
cp ${WORKING_DIR}/${APP_NAME}.app/Contents/MacOS/${EXE_NAME} ${WORKING_DIR}/${EXE_NAME}
fi
rm -rf ${WORKING_DIR}/${APP_NAME}.app
echo "Generate Symbolic file"
if [[ $WORKING_DIR =~ "Release" ]]
then
dsymutil ${WORKING_DIR}/${EXE_NAME} -o ${WORKING_DIR}/${EXE_NAME}.dSYM
fi
echo "Strip symbols in RELEASE only"
if [[ $WORKING_DIR =~ "Release" ]]
then
strip ${WORKING_DIR}/${EXE_NAME}
fi
echo "Build bundle tree"
mkdir ${WORKING_DIR}/${APP_NAME}.app
mkdir ${WORKING_DIR}/${APP_NAME}.app/Contents
mkdir ${WORKING_DIR}/${APP_NAME}.app/Contents/MacOS
mkdir ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources
echo "Add resources"
cp "${RESOURCES_DIR}/icon/shopifight_icon.icns" ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/${EXE_NAME}.icns
cp "${RESOURCES_DIR}/EULA/eula_en.pdf" ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/
#cp "${RESOURCES_DIR}/eula_fr.pdf" ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/
#cp "${DOCS_DIR}/help_en.pdf" ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/
#cp "${DOCS_DIR}/help_fr.pdf" ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/
mkdir ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/en.lproj
mkdir ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/fr.lproj
cp ./${PROJECT_NAME}/lang/fr/wxstd.mo ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/fr.lproj/wxstd.mo
cp ./${PROJECT_NAME}/lang/fr/${PROJECT_NAME}.mo ${WORKING_DIR}/${APP_NAME}.app/Contents/Resources/fr.lproj/${PROJECT_NAME}.mo
echo "Set metadata"
echo 'APPL????' > ${WORKING_DIR}/${APP_NAME}.app/Contents/PkgInfo
cp ./${PROJECT_NAME}/OSX_Info.plist ${WORKING_DIR}/${APP_NAME}.app/Contents/Info.plist
# cp version.plist ${APP_NAME}.app/Contents/
# cp InfoPlist.strings ${APP_NAME}.app/Contents/Resources/English.lproj/
echo "Set executables"
cp ${WORKING_DIR}/${EXE_NAME} ${WORKING_DIR}/${APP_NAME}.app/Contents/MacOS/${EXE_NAME}
rm ${WORKING_DIR}/${EXE_NAME}
echo "Resolve dependencies"
#dylibbundler -of -b -x ./${APP_NAME}.app/Contents/MacOS/${APP_NAME} -x ./${APP_NAME}.app/Contents/MacOS/codesnippets -x ./${APP_NAME}.app/Contents/MacOS/cb_share_config -x ./${APP_NAME}.app/Contents/MacOS/cb_console_runner -x ./${APP_NAME}.app/Contents/MacOS/libcodeblocks.0.dylib -x ./${APP_NAME}.app/Contents/MacOS/libwxsmithlib.0.dylib -x ./${APP_NAME}.app/Contents/MacOS/libwx_macu-2.8.0.dylib -d ./${APP_NAME}.app/Contents/MacOS/
#for dotso in ./${APP_NAME}.app/Contents/MacOS/*.so
#do
#echo $dotso
# install_name_tool -change ${WORKING_DIR}/lib/libcodeblocks.0.dylib @executable_path/libcodeblocks.0.dylib $dotso
# install_name_tool -change ${WORKING_DIR}/lib/libwx_macu-2.8.0.dylib @executable_path/libwx_macu-2.8.0.dylib $dotso
# install_name_tool -change ${WORKING_DIR}/lib/libwxsmithlib.0.dylib @executable_path/libwxsmithlib.0.dylib $dotso
#done
echo Done !
echo ${APP_NAME}.app created in ${WORKING_DIR}
exit 0
Code: Select all
$(PROJECT_DIR)/../OSX_post_build.sh OSX_LLVM-Clang_x64_Debug_wx30 Alify alify
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Missing C++ support in Xcode9.2 for MacOS app?
eranon wrote:Code::Blocks doesn't generate anything for you, but an app bundle is nothing more than a special directory including a normalized tree. It's not so difficult to find some documentations about the structure of an app bundle (what I did when I wanted to produce mines) and you just have to create it at post-build stage from a shell script... And, in my opinion, it's far more instructive to master every step than relaying on an obscure black box like Xcode (freedom is often a matter of knowledge).xuboying wrote:Coud code::blocks generate the necessary bundle file to pack a application so it can be run in lancher?
My task is to write cross-platform C++ project, it's mainly develop in Windows(Visual Studio) with a little adaption in Mac
I can do compile in commandline with wx-config in mac, but no idea of packing to app, it was previously done by older version of Xcode.
Well, here is one of my scripts (here called "OSX_post_build.sh") from one of my projects:
...
Exactly what I need! Thank you so much!!
Apple closes the door and you open it for me
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Missing C++ support in Xcode9.2 for MacOS app?
Enjoy, xuboying!
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Missing C++ support in Xcode9.2 for MacOS app?
Hi,
That was a tutorial on how to create a normal Cocoa C++ application inside Xcode.
And this is exactly what I followed when I was creating my application under OSX with the libraries.
Thank you.
That was a tutorial on how to create a normal Cocoa C++ application inside Xcode.
And this is exactly what I followed when I was creating my application under OSX with the libraries.
Thank you.
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Missing C++ support in Xcode9.2 for MacOS app?
Do you have a link, ONEEYEMAN? I remember, I searched a little (and concatenated various infos from various sources) to achieve the final step for a complete working bundle...
--
EDIT: Oh! but maybe you anwered to "Looks like a guide of creating a commandline c++ project, this is still supported in Xcode9?"... Not sure.
--
EDIT: Oh! but maybe you anwered to "Looks like a guide of creating a commandline c++ project, this is still supported in Xcode9?"... Not sure.
Last edited by eranon on Fri Feb 02, 2018 8:05 pm, edited 1 time in total.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Missing C++ support in Xcode9.2 for MacOS app?
eranon,
Check the link I posted in the very first reply to this thread.
Thank you.
Check the link I posted in the very first reply to this thread.
Thank you.
- eranon
- Can't get richer than this
- Posts: 867
- Joined: Sun May 13, 2012 11:42 pm
- Location: France
- Contact:
Re: Missing C++ support in Xcode9.2 for MacOS app?
OK, understood afterward, ONEEYEMAN (see EDIT I written at the same time you wrote your message above LOL).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
Re: Missing C++ support in Xcode9.2 for MacOS app?
HiONEEYEMAN wrote:Hi,
That was a tutorial on how to create a normal Cocoa C++ application inside Xcode.
And this is exactly what I followed when I was creating my application under OSX with the libraries.
Thank you.
I checked the guide. it was for Xcode is 7.2.1, so I did not read it carefully. The eranon's suggestion is more direct.
Thank your all the same!
Re: Missing C++ support in Xcode9.2 for MacOS app?
Hi,
Are you saying that all those options are gone in the new Xcode?
Thank you.
xuboying wrote:HiONEEYEMAN wrote: Hi,
That was a tutorial on how to create a normal Cocoa C++ application inside Xcode.
And this is exactly what I followed when I was creating my application under OSX with the libraries.
Thank you.
I checked the guide. it was for Xcode is 7.2.1, so I did not read it carefully. The eranon's suggestion is more direct.
Thank your all the same!
Are you saying that all those options are gone in the new Xcode?
Thank you.
Re: Missing C++ support in Xcode9.2 for MacOS app?
ONEEYEMAN wrote:Hi,xuboying wrote:HiONEEYEMAN wrote: Hi,
That was a tutorial on how to create a normal Cocoa C++ application inside Xcode.
And this is exactly what I followed when I was creating my application under OSX with the libraries.
Thank you.
I checked the guide. it was for Xcode is 7.2.1, so I did not read it carefully. The eranon's suggestion is more direct.
Thank your all the same!
Are you saying that all those options are gone in the new Xcode?
Thank you.
Hi
It has been a long time since my last working in Mac (EL capition). Now I doubt the options is not changed in Xcode 7 and Xcode 9. Maybe last time C++ had been removed from Xcode and I just create OC project and wipe OC code then add CPP files to it
However I could not confirm that
Sorry for the poor memory.