Failed to build WxWidgets with GCC in command prompt

柔情痞子 提交于 2021-01-29 10:45:03

问题


I am following the official instructions to build WxWidgets with GCC. 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:

../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:

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

OK, I tried something new.

  • Using Cygwin64 terminal:
    • 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?


回答1:


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;

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? You need to be in a new subfolder below c:\wxWidgets-3.1.1. From that subfolder you run ../configure, see c:\wxWidgets-3.1.1\configure file.




回答2:


This is how I managed to get it compiled using Command Prompt (console) and this Wiki guide:

  • 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. I still have problem with the Cygwin64 method. Will update.



来源:https://stackoverflow.com/questions/50953431/failed-to-build-wxwidgets-with-gcc-in-command-prompt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!