简体   繁体   中英

Issues with wxwidgets and VSCode

OS: linux

IDE: VSCode

complier: CMake but I can use another if better results are given

Hello I am wanting to learn how to apply c++ for cross platform development. I have chose to use WxWidgets, however, after compiling I ran into an issue, I could not integrate WxWidgets. I tried using vcpkg because it seemed simpler to integrate I ran the following after the./vcpkg integrate install

cmake -DCMAKE_TOOLCHAIN_FILE=/home/places/vcpkg/scripts/buildsystems/vcpkg.cmake

I then got the issue

CMake Error at /usr/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
wxWidgets_INCLUDE_DIRS)

I pretty certain I am not missing the libraries and that the issue lies in configuration. Here is part of my CMakeLists.txt

 set(wxWidgets_CONFIGURATION mswu)`
 SET(wxWidgets_ROOT_DIR "home/places/wxwidget/wxWidgets-3.1.4/")
 SET(wxWidgets_LIBRARIES "home/places/wxwidget/wxWidgets-3.1.4/lib/")
 SET(wxWidgets_LIB_DIR "home/places/wxWidgets-3.1.4/lib/libwx_baseu-3.1.so")
 SET(wxWidgets_CONFIGURATION "mswd")
 find_package(wxWidgets COMPONENTS core base REQUIRED)
 include(${wxWidgets_USE_FILE})

I also tried the wxwidgets-vscode helloworld found here https://github.com/huckor/wxwidgets-vscode/blob/master/.vscode/launch.json

I really appreciate any help and thankyou.

Please do the following

  1. Open the Terminal.

  2. Do `cd </path/to/your/source/code>.

  3. Do

    g++ -o <your_binary_name> wx-config --cxxflags --libs *.cpp

Did it work?

Thank you.

BTW, CMake is not a compiler - its a tool to generate Makefile and project files for different IDEs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM