简体   繁体   English

在 Windows 10 上使用 wxWidgets(MinGW 模式)编译源代码的问题

[英]Problems to compile source code with wxWidgets (MinGW mode) on Windows 10

I am having serious problems to compile a code in Windows (regard3d at http://www.regard3d.org ).我在 Windows 中编译代码时遇到了严重的问题( http://www.regard3d.org 上的regard3d)。 I have read so many post (two days blocked on this problem) here at stackoverflow and other sites, but without success.我在 stackoverflow 和其他网站上阅读了很多帖子(在这个问题上被阻止了两天),但没有成功。

The problem is that it needs wxWidgets.问题是它需要 wxWidgets。 For that I am using MinGW.为此,我正在使用 MinGW。 I have VS Community (the latest version).我有 VS 社区(最新版本)。 I run my CMakeLists.txt and everytime I get the message我运行我的 CMakeLists.txt 并且每次我收到消息

Could NOT find wxWidgets (missing: wxwidgets_LIBRARIES wxwidgets_INCLUDE_DIRS)

I included the wxWidgets installation directory (which is C:\\wxWidgets-3.1.0 ) in PATH variable (I restarted to it takes effect) and created the variable WXWIN (that also contains the installation directory).我在PATH变量中包含了 wxWidgets 安装目录(即C:\\wxWidgets-3.1.0 )(我重新启动它生效)并创建了变量WXWIN (也包含安装目录)。

The question: What can I do to solve it?问题:我能做些什么来解决它?

I think the problem is not building the wxWidgets, but make it be found my cmake.我认为问题不在于构建 wxWidgets,而是让它找到我的 cmake。 As mentioned, I built it using MinGW, thus I have the folder C:\\wxWidgets-3.1.0\\lib\\gcc_dll and the folder C:\\wxWidgets-3.1.0\\include which contains two more folders named wx and msvc .如前所述,我使用 MinGW 构建它,因此我有文件夹C:\\wxWidgets-3.1.0\\lib\\gcc_dll和文件夹C:\\wxWidgets-3.1.0\\include ,其中包含另外两个名为wxmsvc文件夹。 I am using the following settings before call the cmake:在调用 cmake 之前,我正在使用以下设置:

set wxWidgets_ROOT_DIR=C:\wxWidgets-3.1.0
set R3D_ALT_wxWidgets_INCLUDE_DIRS=include
set R3D_ALT_wxWidgets_LIBRARIES=lib\gcc_dll 
set wxWidgets_CONFIG_EXECUTABLE=build\msw 

I'm not very familiar with wxWidgets (so this should probably be a comment, but I can't comment because reasons......), but a quick hack that should work is just throwing the path to the library in LD_LIBRARY_PATH or including it by adding我对 wxWidgets 不是很熟悉(所以这可能应该是一个评论,但我不能评论因为原因......),但是一个应该有效的快速黑客只是在 LD_LIBRARY_PATH 中抛出库的路径或通过添加包括它

CPPFLAGS += -L C:\wxWidgets-3.1.0\lib\gcc_dll -I C:\wxWidgets-3.1.0\include

to your makefile.到你的makefile。

Failing that, you could explicitly set the environmental variables it's complaining about outside of the makefile.否则,您可以在 makefile 之外显式设置它抱怨的环境变量。

Again, sorry, this should be a comment.再次,抱歉,这应该是评论。 It's not... If someone wants to copy it to a comment and delete this, that'd be grand.不是...如果有人想把它复制到评论中并删除它,那太好了。

Thank all of you.谢谢大家。 Solved!解决了! Yesterday I compiled both with MinGW and VS and settled the wxWidgets-3.1.0_INCLUDE_DIRS and it worked!昨天我用 MinGW 和 VS 编译并解决了 wxWidgets-3.1.0_INCLUDE_DIRS 并且它起作用了!

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

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