Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用MinGW对DevIL函数的未定义引用 我在C++链接、静态和动态方面都不太有经验,LIB的VS。A,等等。_C++_Windows_Mingw_Eclipse Cdt_Devil - Fatal编程技术网

使用MinGW对DevIL函数的未定义引用 我在C++链接、静态和动态方面都不太有经验,LIB的VS。A,等等。

使用MinGW对DevIL函数的未定义引用 我在C++链接、静态和动态方面都不太有经验,LIB的VS。A,等等。,c++,windows,mingw,eclipse-cdt,devil,C++,Windows,Mingw,Eclipse Cdt,Devil,请注意,下面我为所有DevIL库(DevIL、ILU、ILUT)提供了-l。至于库文件,我将dll放在System32和SysWOW64中,将.libs放在MinGW\lib中。Eclipse项目的“当前工具链”实际上是MingWGCC。该项目只有一个源文件facecube.cpp(has main())。我错过了什么 包括: #include "Angel.h" #include <IL\config.h> #include <IL\ilut_config.h> #in

请注意,下面我为所有DevIL库(DevIL、ILU、ILUT)提供了-l。至于库文件,我将dll放在System32和SysWOW64中,将.libs放在MinGW\lib中。Eclipse项目的“当前工具链”实际上是MingWGCC。该项目只有一个源文件facecube.cpp(has main())。我错过了什么

包括:

#include "Angel.h"
#include <IL\config.h>
#include <IL\ilut_config.h>
#include <IL\il.h>
#include <IL\ilu.h>
#include <IL\ilut.h>
#include <iostream>
using namespace std;
上面忽略的pragma警告的代码(对我来说似乎无关紧要):


看起来您混合了32位和64位模块。具体来说,当我编译32位程序但链接到64位DevIL库时,也会遇到同样的问题


确保您已下载并链接到DevIL-SDK-x86-1.7.8 SDK()。您还应该确保您使用的是来自相应SDK的头,尽管这可能不那么重要。

看起来您混合了32位和64位模块。具体来说,当我编译32位程序但链接到64位DevIL库时,也会遇到同样的问题


确保您已下载并链接到DevIL-SDK-x86-1.7.8 SDK()。您还应该确保使用的是来自相应SDK的头,尽管这可能不那么重要。

儿子……就是这样!我感谢你花时间复制它。我很好奇,有没有什么东西告诉你我的程序是32位的?是不是我的其他图书馆在em中有“32”?所以一般来说,你不能在一个程序中混合使用32位和64位库?@bbarre:不,你不能在一个程序中混合使用32位和64位库。为了解决您的问题,我尝试了一个快速测试,构建了一个只调用
iluInit()
的程序。它没有问题,所以我做了一个快速测试,试图将它链接到64位libs,看看会出现什么错误。我不确定您是否正在构建一个32位程序,但您必须千方百计获得一个支持x64目标的MinGW工具链。另外,我在构建一个针对32位库的64位程序时遇到的错误是不同的。狗娘养的……就是这样!我感谢你花时间复制它。我很好奇,有没有什么东西告诉你我的程序是32位的?是不是我的其他图书馆在em中有“32”?所以一般来说,你不能在一个程序中混合使用32位和64位库?@bbarre:不,你不能在一个程序中混合使用32位和64位库。为了解决您的问题,我尝试了一个快速测试,构建了一个只调用
iluInit()
的程序。它没有问题,所以我做了一个快速测试,试图将它链接到64位libs,看看会出现什么错误。我不确定您是否正在构建一个32位程序,但您必须千方百计获得一个支持x64目标的MinGW工具链。另外,我在针对32位库构建64位程序时遇到的错误也不同。
16:50:49 **** Rebuild of configuration Release for project TextureCube ****
Info: Internal Builder is used for build
g++ -DGLEW_STATIC "-IC:\\Users\\Brent\\Desktop\\angel_code\\include" "-IC:\\Users\\Brent\\Desktop\\6631AdvGraphics\\4631_HW4_brent_barre\\include" -O3 -Wall -c -fmessage-length=0 -o facecube.o "..\\facecube.cpp" 
In file included from ..\facecube.cpp:7:0:
C:\Users\Brent\Desktop\6631AdvGraphics\4631_HW4_brent_barre\include/IL/ilut.h:333:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
C:\Users\Brent\Desktop\6631AdvGraphics\4631_HW4_brent_barre\include/IL/ilut.h:334:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
C:\Users\Brent\Desktop\6631AdvGraphics\4631_HW4_brent_barre\include/IL/ilut.h:356:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
..\facecube.cpp: In function 'void quad(int, int, int, int)':
..\facecube.cpp:56:12: warning: unused variable 'colors' [-Wunused-variable]
..\facecube.cpp: In function 'void init()':
..\facecube.cpp:129:38: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
..\facecube.cpp:130:39: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
In file included from C:\Users\Brent\Desktop\angel_code\include/Angel.h:75:0,
                 from ..\facecube.cpp:6:
C:\Users\Brent\Desktop\angel_code\include/CheckError.h: At global scope:
C:\Users\Brent\Desktop\angel_code\include/CheckError.h:37:1: warning: 'void _CheckError(const char*, int)' defined but not used [-Wunused-function]
g++ -DGLEW_STATIC "-IC:\\Users\\Brent\\Desktop\\angel_code\\include" "-IC:\\Users\\Brent\\Desktop\\6631AdvGraphics\\4631_HW4_brent_barre\\include" -O3 -Wall -c -fmessage-length=0 -o "Common\\InitShader.o" "..\\Common\\InitShader.cpp" 
In file included from C:\Users\Brent\Desktop\angel_code\include/Angel.h:75:0,
                 from ..\Common\InitShader.cpp:2:
C:\Users\Brent\Desktop\angel_code\include/CheckError.h:37:1: warning: 'void _CheckError(const char*, int)' defined but not used [-Wunused-function]
g++ -o TextureCube.exe facecube.o "Common\\InitShader.o" -lfreeglut -lglew32 -lopengl32 -lwinmm -lgdi32 -lDevIL -lILU -lILUT 
facecube.o:facecube.cpp:(.text+0x53f): undefined reference to `__imp__ilInit@0'
facecube.o:facecube.cpp:(.text+0x545): undefined reference to `__imp__iluInit@0'
facecube.o:facecube.cpp:(.text+0x54b): undefined reference to `__imp__ilutInit@0'
facecube.o:facecube.cpp:(.text+0x558): undefined reference to `__imp__ilutRenderer@4'
facecube.o:facecube.cpp:(.text+0x566): undefined reference to `__imp__ilutGLLoadImage@4'
collect2.exe: error: ld returned 1 exit status

16:50:50 Build Finished (took 1s.38ms)
333 #pragma warning(push)
334 #pragma warning(disable : 4115)  // Disables 'named type definition in parentheses' warning
...
356 #pragma warning(pop)