[英]( __ printf __ ) cannot be found in DLL (programfiles(x86)\codeblocks\mingw\bin\as.exe)
I'm trying to learn wxwidgets for cross platform GUI development, however I faced a problem. 我正在尝试为跨平台GUI开发学习wxwidget,但是我遇到了一个问题。
When try to build wxwidgets with mingW32 I run into errors. 尝试使用mingW32构建wxwidget时遇到错误。 I installed minGW32 with codeblocks 16.1 (works fine), added PATH to System Environment.
我安装了带有代码块16.1的minGW32(工作正常),并向系统环境添加了PATH。 Downloaded all possibilities from wxwidgets.org.
从wxwidgets.org下载了所有可能性。 None of them wants to compile when I try to compile wxwidgets library from cmd with mingw32.
当我尝试使用mingw32从cmd编译wxwidgets库时,它们都不希望编译。 I go into
wxwidgets/build/msw
, typed several versions but to mention one: 我进入
wxwidgets/build/msw
,输入了多个版本,但只提到了一个:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
(tried without shared, monolitic, even debug mode) (尝试不使用共享,独占甚至调试模式)
About the error: 关于错误:
( __ printf __ ) cannot be found in DLL
(programfiles(x86)\codeblocks\mingw\bin\as.exe)
I have the exe, tried to reinstall everything from scratch several times. 我安装了exe,试图多次重新安装所有内容。 I'm using Windows 10.
我正在使用Windows 10。
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
makefile.gcc:5778: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Update: 更新:
After reinstalling and deleting everything connected to this, the problem has changed. 重新安装并删除与此连接的所有内容后,问题已更改。 The code I use, tried without the flag, and with flag but only"-std=gnu++11" too:
我使用的代码尝试了不带标志,也带标志,但也只有“ -std = gnu ++ 11”:
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11"
The new error code: 新的错误代码:
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Any infos about the fact that I could not ever compile wxwidget with codeblocks' built in compiler? 关于我无法使用内置于编译器中的代码块编译wxwidget的事实的任何信息? without addons?
没有插件?
Delete everything: wxWidgets, Code::Blocks and MinGW or TDM-GCC 删除所有内容:wxWidgets,Code :: Blocks和MinGW或TDM-GCC
* Download and install C::B, without MinGW or TDM *下载并安装C :: B, 而不使用 MinGW或TDM
* Download TDM-GCC from here . *从这里下载TDM-GCC。 If you install both 32 & 64 bits versions I suggest you to install them in two different folders.
如果同时安装32位和64位版本,建议您将它们安装在两个不同的文件夹中。
* Download wxWidgets *下载wxWidgets
Open a command window. 打开命令窗口。 Say you have TDM at "C:\\TDM32" and wxWidgets at "C:\\myWX".
假设您在“ C:\\ TDM32”有TDM,在“ C:\\ myWX”有wxWidgets。
Use these commands to compile wxWidgets: 使用以下命令来编译wxWidgets:
PATH=%PATH%;C:\TDM32\bin
cd C:\myWX\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
This should build an only .dll
file with most of wxWidgets. 这应该使用大多数wxWidgets构建唯一的
.dll
文件。 Not OpenGL. 不是OpenGL。
If you prefer several .dll
don't use "Monolitic=1" 如果您喜欢多个
.dll
请不要使用“ Monolitic = 1”
If you prefer not using wx'dlls, but static '.a' files added to your app, don't use "shared=1" 如果您不想使用wx'dll,而是将静态.a文件添加到应用中,请不要使用“ shared = 1”
If you want to step into wxWidgets code when using a debugger, use "BUILD=debug" 如果要在使用调试器时进入wxWidgets代码,请使用“ BUILD = debug”
If you want OpenGL use "USE_OPENGL=1" 如果要OpenGL,请使用“ USE_OPENGL = 1”
To build wxWidgets with C++11 use CXXFLAGS="-std=gnu++11"
要使用C ++ 11构建wxWidget,请使用
CXXFLAGS="-std=gnu++11"
For your own app you must tell C::B: 对于您自己的应用程序,您必须告诉C :: B:
* where the TDM compiler can be found *可以找到TDM编译器的地方
* where the wxWidgets headers can be found *在哪里可以找到wxWidgets标头
* where the wxWidgets libraries (.dll or .a depending if you compiled with "shared") can be found *在哪里可以找到wxWidgets库(.dll或.a,取决于是否使用“共享”进行编译)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.