简体   繁体   English

设置Netbeans以在Windows下编译wxWidgets项目

[英]Setting up Netbeans to compile wxWidgets projects under Windows

I'm trying to set up my Netbeans IDE so that it is capable of compiling wxWidgets projects. 我正在尝试设置我的Netbeans IDE,以便它能够编译wxWidgets项目。

There is very similar question: Setup wxWidget in Netbeans 6.1 C++ On MS Windows? 有一个非常类似的问题: 在MSB上安装Netbeans 6.1 C ++中的wxWidget? but the answer is not working for me. 但答案对我不起作用。 And the mentioned versions are a bit outdated. 并且提到的版本有点过时了。

I use the mingw package for compilation. 我使用mingw包进行编译。 There is no problem compiling a small hello World App from the console using this command in mysys: 在mysys中使用此命令从控制台编译一个小的hello World App是没有问题的:

$ g++ hello.cpp `wx-config --libs` `wx-config --cxxflags` -o hello.exe

So here's what I tried in Netbeans: 所以这就是我在Netbeans中尝试的内容:
Project properties: 项目属性:

  • C++ Compiler -> Additional Options: wx-config cxxflags (surrounded by backticks) C ++编译器 - >附加选项: wx-config cxxflags (由反引号包围)
  • C++ Compiler -> Include directories: installation_Path/include C ++编译器 - >包含目录:installation_Path / include
  • Linker -> Additional Options: wx-config --libs (surrounded by backticks) 链接器 - >附加选项: wx-config --libs (由反引号包围)

The command lines Netbeans creates when I try to compile seem to be correct to me 当我尝试编译时,Netbeans创建的命令行似乎对我来说是正确的

g++.exe `wx-config --cxxflags` -c -g -I/D/lib/wxWidgets/include -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp

This compiles without errors 这编译没有错误

g++.exe `wx-config --cxxflags`  `wx-config --libs` -o dist/Debug/MinGW-Windows/wxwidgetstest build/Debug/MinGW-Windows/main.o -L/D/lib/wxWidgets/lib/gcc_lib

But during the linking process I get loads of errors... 但在链接过程中我遇到了大量错误......

Questions: 问题:

  • Does anybody have a working configuration for compiling wxWidgets Projects from within Netbeans and can help me out 有没有人有一个工作配置来编译Netbeans内部的wxWidgets项目,可以帮助我
  • Or does anybody see an error in the command lines could be the reason for the linking problems ? 或者有人看到命令行中的错误可能是链接问题的原因吗?

Thank you very much! 非常感谢你!

I finally found the solution, and wrote a guide for anyone who might encounter the same problem in the future. 我终于找到了解决方案,并为将来可能遇到同样问题的人写了一份指南。

wxWidgets wiki: Compiling using Netbeans wxWidgets wiki:使用Netbeans进行编译

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

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