cmake, wxWidgets , CLion, Mac OS X M1 Ventura 13.1

已完成

While trying to learn wxWidgets and CMake, I stumbled across this link which has the supporting GitHub

When trying to build this with Clion it fails with the following message:

CMake Error at /Users/xyz/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/223.8214.51/CLion.app/Contents/bin/cmake/mac/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /Users/xyz/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/223.8214.51/CLion.app/Contents/bin/cmake/mac/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /Users/xyz/Library/Application Support/JetBrains/Toolbox/apps/CLion/ch-0/223.8214.51/CLion.app/Contents/bin/cmake/mac/share/cmake-3.24/Modules/FindwxWidgets.cmake:977 (find_package_handle_standard_args)
  CMakeLists.txt:21 (find_package)

The CMakeError.log contains:

Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Some help required resolving this error? Is it wxWidgets, CLion or CMake?

CMake version is 3.24.2 wxWidgets is 3.2.1

 

Because cmake is installed with CLion I also cannot test this from the command line with:

cmake -S. -Bbuild && cmake --build build

 

if I do:

where cmake nothing is returned.

how can this be achieved?

Are you able to try the project your end on a Mac to see what I am referring to here?

0

incidentally if I install cmake with brew and run this from within terminal inside CLion, the command below succeeds without error.

 

cmake -S. -Bbuild && cmake --build build

0

Solved the issue now, it seems the version of cmake with latest CLion is 3.24.2 and if I install 3.25.1 and point to that it works, even though CLion does not support it.

0

请先登录再写评论。