简体   繁体   English

wxwidgets 和 VSCode 的问题

[英]Issues with wxwidgets and VSCode

OS: linux操作系统:linux

IDE: VSCode IDE:VSCode

complier: CMake but I can use another if better results are given编译器:CMake 但如果给出更好的结果我可以使用另一个

Hello I am wanting to learn how to apply c++ for cross platform development.您好我想学习如何应用c++进行跨平台开发。 I have chose to use WxWidgets, however, after compiling I ran into an issue, I could not integrate WxWidgets.我选择使用WxWidgets,但是编译后遇到问题,无法集成WxWidgets。 I tried using vcpkg because it seemed simpler to integrate I ran the following after the./vcpkg integrate install我尝试使用 vcpkg,因为它似乎更易于集成我在 ./vcpkg 集成安装之后运行了以下命令

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这是我的 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我还尝试了在这里找到的 wxwidgets-vscode helloworld 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>.执行 `cd </path/to/your/source/code>。

  3. Do

    g++ -o <your_binary_name> wx-config --cxxflags --libs *.cpp 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.顺便说一句, CMake不是编译器 - 它是为不同 IDE 生成 Makefile 和项目文件的工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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