Compiling on mac 10.6 (el capitan), problem with .app executable  [SOLVED]

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
ChronoGraff
Knows some wx things
Knows some wx things
Posts: 42
Joined: Wed Apr 22, 2015 5:42 pm

Compiling on mac 10.6 (el capitan), problem with .app executable  [SOLVED]

Postby ChronoGraff » Sat Jan 27, 2018 12:50 pm

Hi folks, I have a problem. When compiling the .app the executable is not in the .app/Contents/MacOs/ directory. I am lost as to why this is happening. Below I have included some trace. If someone could point me in the correct direction I will try to solve this with a little help.

Thanks again

Ignore the unused warning in the linker, trace:

Code: Select all

[ 54%] Linking CXX static library ../../bin/lib/libchrono.a
[ 95%] Built target chrono
[100%] Linking CXX executable ../../bin/ChronoGraff.app/Contents/MacOS/ChronoGraff
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /usr/local/Cellar/llvm/5.0.1/bin
clang-5.0: warning: -Wl,-search_paths_first: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -Wl,-headerpad_max_install_names: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lcurl: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -ljsoncpp: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -ljansson: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: /usr/local/lib/librestclient-cpp.a: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: /usr/local/lib/libsqlcipher.a: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework Security: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework CoreFoundation: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: ../../bin/lib/libchrono.a: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework IOKit: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework Carbon: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework Cocoa: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework AudioToolbox: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework System: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -framework OpenGL: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_baseu-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_osx_cocoau_aui-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_osx_cocoau_core-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_osx_cocoau_adv-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_osx_cocoau_ribbon-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_osx_cocoau_richtext-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: -lwx_baseu_net-3.1: 'linker' input unused [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-std=c++17' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-O2' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-Wall' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-g' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
[100%] Built target ChronoGraff


CMake compiler settings:

Code: Select all

if(NOT ${CMAKE_VERSION} LESS 3.2)
    set(CMAKE_CXX_STANDARD 11)
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
else()
    message(STATUS "Checking compiler flags for C++11 support.")
    # Set C++11 support flags for various compilers
    include(CheckCXXCompilerFlag)

    check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
    check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)

    set(CMAKE_C_COMPILER /usr/local/Cellar/llvm/5.0.1/bin/clang)
    set(CMAKE_CXX_COMPILER /usr/local/Cellar/llvm/5.0.1/bin/clang++)

    if(COMPILER_SUPPORTS_CXX11)
        message(STATUS "C++11 is supported.")
        if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
            set(CMAKE_CXX_CFLAGS"${CMAKE_CXX_FLAGS} -Wunused-parameter -Wunused-command-line-argument -Wextra")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -c")
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -c")
        endif()
    elseif(COMPILER_SUPPORTS_CXX0X)
        message(STATUS "C++0x is supported.")
        if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
        else()
            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
        endif()
    else()
        message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
    endif()
endif()

ChronoGraff
Knows some wx things
Knows some wx things
Posts: 42
Joined: Wed Apr 22, 2015 5:42 pm

Re: Compiling on mac 10.6 (el capitan), problem with .app executable

Postby ChronoGraff » Sat Jan 27, 2018 2:21 pm

I solved this by compiling with, my os is El Capitan 10.6:

Code: Select all

./configure CC="/usr/local/Cellar/llvm/5.0.1/bin/clang" CXX="/usr/local/Cellar/llvm/5.0.1/bin/clang++"  --disable-mediactrl --without-liblzma --disable-lzma --with-osx_cocoa --with-macosx-version-min=10.6 --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2787
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Compiling on mac 10.6 (el capitan), problem with .app executable

Postby ONEEYEMAN » Mon Jan 29, 2018 3:41 pm

Hi,
2 observations:

1. OSX El Capitan is not version 10.6.
2. The minimum OSX requirements for 3.0 branch is 10.6, for 3.1 - it is 10.7.

I am not sure configure script will check minimum OSX required, so just be carefulo of what you compile with what minimum version requirements.

Thank you.


Return to “Compiler / Linking / IDE Related”

Who is online

Users browsing this forum: No registered users and 7 guests