简体   繁体   English

无法在命令提示符下使用GCC构建WxWidgets

[英]Failed to build WxWidgets with GCC in command prompt

I am following the official instructions to build WxWidgets with GCC. 我正在按照官方说明使用GCC构建WxWidgets。 For some reason, it fails to build and gives me this error: 由于某种原因,它无法构建,并给我这个错误:

失败

Could someone tell me what is the problem here? 有人可以告诉我这是什么问题吗? I did try to use Cygwin to build, but encountered error when trying this line: 我确实尝试使用Cygwin进行构建,但是尝试以下行时遇到错误:

../configure --enable-debug

It complained: 它抱怨:

-bash: ../configure: No such file or directory

I am at the end of my wits now, and cannot figure out how to get it done. 我现在机智不足,无法弄清楚如何完成它。 Someone please help. 有人请帮忙。

This is what PATH shows up in commmand prompt: 这是PATH在命令提示符中显示的内容:

路径

=========================================== ===========================================

OK, I tried something new. 好,我尝试了一些新东西。

  • Using Cygwin64 terminal: 使用Cygwin64终端:
    • cd /cygdrive/C/wxWidgets-3.1.1/build-debug
    • ../configure --enable-debug
    • make

Afterwards, I tried: 之后,我尝试了:

  • cd samples/minimal
  • make

And I encountered this error: 我遇到了这个错误:

g++ -o minimal.exe minimal_sample_rc.o minimal_minimal.o    -L/cygdrive/C/wxWidgets-3.1.1/build-debug/lib -mwindows    -lwx_mswu_core-3.1  -lwx_baseu-3.1    -lwxtiff-3.1 -lwxjpeg-3.1 -lwxpng-3.1   -lwxzlib-3.1 -lwxregexu-3.1 -lwxexpat-3.1 -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc -lkernel32 -luser32  -lrpcrt4 -loleaut32 -lole32 -luuid -luxtheme -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lcomdlg32 -ladvapi32 -lversion -lwsock32 -lgdi32 -loleacc -lkernel32 -luser32
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwx_mswu_core-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwx_baseu-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxtiff-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxjpeg-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxpng-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxzlib-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxregexu-3.1
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lwxexpat-3.1
collect2: error: ld returned 1 exit status
make: *** [Makefile:149: minimal.exe] Error 1

Can someone tell me why my Cygwin64 build failed? 有人可以告诉我为什么我的Cygwin64构建失败吗?

You have several simple ways to try: 您可以尝试几种简单的方法:

  • Use VS 2014 which PATH suggests you have installed, and open c:\\wxWidgets-3.1.1\\build\\msw\\wx_vc14.sln ; 使用PATH建议您已安装的VS 2014,然后打开c:\\wxWidgets-3.1.1\\build\\msw\\wx_vc14.sln

OR 要么

  • Open a console and do 打开控制台并执行
    • PATH=C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin;%PATH%
    • cd c:\\wxWidgets-3.1.1\\build\\msw
    • mingw32-make.exe -f makefile.gcc

OR 要么

Where exactly did you run configure from? 您从哪里确切地运行configure? You need to be in a new subfolder below c:\\wxWidgets-3.1.1 . 您需要位于c:\\wxWidgets-3.1.1下的新子文件夹中。 From that subfolder you run ../configure , see c:\\wxWidgets-3.1.1\\configure file. 在该子文件夹中运行../configure ,请参阅c:\\wxWidgets-3.1.1\\configure文件。

This is how I managed to get it compiled using Command Prompt (console) and this Wiki guide : 这就是我设法使用命令提示符(控制台)和此Wiki指南对其进行编译的方式:

  • Open a console: 打开控制台:
    • PATH=C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin;C:\\wxWidgets-3.1.1\\include\\wx;%PATH%
    • cd c:\\wxWidgets-3.1.1\\build\\msw
    • mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0

That extra SHELL=CMD.exe saves me from running into some error codes. 额外的SHELL=CMD.exe我免于SHELL=CMD.exe一些错误代码。 I still have problem with the Cygwin64 method. Cygwin64方法仍然有问题。 Will update. 将更新。

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

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