wxWidgets 库在链接器中构建乱码的文件名 [英] wxWidgets library build garbled file name in linker

查看:29
本文介绍了wxWidgets 库在链接器中构建乱码的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试构建 wxWidgets 3.1.0 库时,我收到此错误

On attempting to build wxWidgets 3.1.0 libraries, I am getting this error

ar: gcc_mswu\moolib_fontmap.o: No such file or directory

确实存在拼写略有不同的文件

A file does exists with a slightly different spelling

 Directory of C:\Users\James\code\wxwidgets-3.1.0\build\msw\gcc_mswu

2017-01-05  02:01 PM            98,886 monolib_fontmap.o

它看起来像是 makefile 中的一个错字,或者像是在阅读 makefile 时漏掉了一个字母.这可能吗?

It looks like a typo in the makefile, or like a letter is missed reading the makefile. Is that possible?

除了:如果我将控制台输出重定向到一个文件并在编辑器中打开,则会显示正确的拼写:

Except: if I redirect the console output to a file and open in an editor , the correct spelling shows up:

所以正确的命令是发给链接器的,但是链接器正在寻找一个乱码的文件名!

So the correct command is going to the linker, but the linker is looking for a garbled filename!

这是我正在做的事情的完整配方:

Here is the complete recipe for what I am doing:

Download wxWidgets source code from https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.7z

Unpack to a folder. On my system, I use C:\Users\James\code\wxwidgets-3.1.0

Open a command window.

cd to the code::blocks mingw folder. On my system this is C:\Program Files (x86)\CodeBlocks16\MinGW

Type mingwvars.bat

cd to wxwidgets folder. On my system C:\Users\James\code\wxwidgets-3.1.0

cd to ./build/msw

Type mingw32-make SHELL=CMD.exe -j4 -f makefile.gcc BUILD=release UNICODE=1 SHARED=0 MONOLITHIC=1

推荐答案

这似乎是和前面提到的一样的问题 在维基.显然,mingw32-make 中有一个错误,命令行很长,这使得它(有时?)吃掉其中的字符......

This seems to be the same problem as the one mentioned in the wiki. Apparently there is a bug in mingw32-make with very long command lines which makes it (sometimes?) eat characters in them...

是的.应用您发布的链接中的配方解决了问题.详情如下:

Yes. Applying the recipe in the link you posted fixed the problem. Here are the details:

修改makefile.gcc如下:

modify makefile.gcc as following:

来自:

ifeq ($(MONOLITHIC),1)
ifeq ($(SHARED),0)
$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a: $(MONOLIB_OBJECTS)
    if exist $@ del $@
    ar rcu $@ $(MONOLIB_OBJECTS)
    ranlib $@
endif
endif

用 gcc_mswu\monolib*.o 替换第二次出现的 $(MONOLIB_OBJECTS):

Replace second occurence of $(MONOLIB_OBJECTS) with gcc_mswu\monolib*.o:

ifeq ($(MONOLITHIC),1)
ifeq ($(SHARED),0)
$(LIBDIRNAME)\libwx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).a: $(MONOLIB_OBJECTS)
    if exist $@ del $@
    ar rcu $@ gcc_mswu\\monolib*.o
    ranlib $@
endif
endif

这篇关于wxWidgets 库在链接器中构建乱码的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆