Erreur de type undefined reference to `_imp_*'
Bonsoir,
Voilà plusieurs heures que je cherche, et impossible de résoudre :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -D_WIN32 -DMY_USE_MEMORY -DMY_USE_ASSERT -DQT_DLL -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Programmation\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"Source" -I"..\..\Library\Source" -I"c:\Programmation\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"Build\Win32\Debug\Moc" -I"c:\Programmation\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++" -o Build\Win32\Debug\Object\Main.o Source\Main.cpp
g++ -mthreads -Wl,-subsystem,windows -o Build\Win32\Debug\Playground.exe Build/Win32/Debug/Object/Main.o -L"c:\Programmation\QtSDK\Desktop\Qt\4.8.1\mingw\lib" -lmingw32 -lqtmaind -L../../Library/Build/Win32/Debug/ -lMyEngine
mingw32-make.exe[1]: Leaving directory `F:/Programmation/MyEngine/Sample/Playground'
Build/Win32/Debug/Object/Main.o: In function `main':
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:12: undefined reference to `_imp___ZN2My6WindowD1Ev'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:10: undefined reference to `_imp___ZN2My6WindowD1Ev'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [Build\Win32\Debug\Playground.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
20:15:46: Le processus "C:\Programmation\QtSDK\mingw\bin\mingw32-make.exe" s'est terminé avec le code 2.
Erreur à la compilation du projet MyEngine (cible : Desktop)
Lors de l'exécution de l'étape "Make" |
J'utilise qt-creator pour la gestion du projet, dont voici le .pro.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
TARGET = Playground
QT -= \
core \
gui \
INCLUDEPATH += \
./Source \
../../Library/Source \
DEPENDPATH += \
./Source \
../../Library/Source \
############################################################
# Windows specific settings.
############################################################
win32 {
############################################################
# Build dependant paths.
############################################################
CONFIG(debug, debug|release) {
DESTDIR = Build/Win32/Debug
OBJECTS_DIR = Build/Win32/Debug/Object
MOC_DIR = Build/Win32/Debug/Moc
} else {
DESTDIR = Build/Win32/Release
OBJECTS_DIR = Build/Win32/Release/Object
MOC_DIR = Build/Win32/Release/Moc
}
############################################################
# Libraries.
############################################################
CONFIG(debug, debug|release) {
LIBS += -L../../Library/Build/Win32/Debug/ -lMyEngine
} else {
LIBS += -L../../Library/Build/Win32/Release/ -lMyEngine
}
############################################################
# Defines.
############################################################
DEFINES += \
_WIN32 \
}
############################################################
# Unix specific settings.
############################################################
unix {
############################################################
# Build dependant paths.
############################################################
CONFIG(debug, debug|release) {
DESTDIR = Build/Unix/Debug
OBJECTS_DIR = Build/Unix/Debug/Object
MOC_DIR = Build/Unix/Debug/Moc
} else {
DESTDIR = Build/Unix/Release
OBJECTS_DIR = Build/Unix/Release/Object
MOC_DIR = Build/Unix/Release/Moc
}
############################################################
# Libraries.
############################################################
CONFIG(debug, debug|release) {
LIBS += -L../../Library/Build/Unix/Debug/ -lMyEngine
} else {
LIBS += -L../../Library/Build/Unix/Release/ -lMyEngine
}
############################################################
# Defines.
############################################################
DEFINES += X11 \
}
############################################################
# Compiler flags.
############################################################
############################################################
# Headers.
############################################################
############################################################
# Sources.
############################################################
SOURCES += \
Source/Main.cpp \
############################################################
# Defines.
############################################################
DEFINES += \
MY_USE_MEMORY \
MY_USE_ASSERT \ |
Pour finir voici le fichier Main.cpp :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
#include "Core/Application.hpp"
#include "Core/Window.hpp"
int main(int argc, char *argv[])
{
// Ici il est étonnant que cette méthode ne pose aucun problème...
My::Window::Initialize();
My::Window main_window("test");
return 0;
} |
Je parviens à instancier certaines des classes de ma .dll alors que d'autres non.
Par exemple si je commente la LIBS dans le .pro j'obtiens le même type d'erreurs :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:8: undefined reference to `_imp___ZN2My5MutexC1Eb'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:9: undefined reference to `_imp___ZN2My5Mutex4LockEv'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:11: undefined reference to `_imp___ZN2My5Mutex6UnlockEv'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:14: undefined reference to `_imp___ZN2My6Window10InitializeEv'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:16: undefined reference to `_imp___ZN2My6WindowC1ERKSsjj'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:17: undefined reference to `_imp___ZN2My6Window10InitializeEv'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:16: undefined reference to `_imp___ZN2My6WindowD1Ev'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:19: undefined reference to `_imp___ZN2My6WindowD1Ev'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:19: undefined reference to `_imp___ZN2My6WindowD1Ev'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:19: undefined reference to `_imp___ZN2My5MutexD1Ev'
F:\Programmation\MyEngine\Sample\Playground/Source/Main.cpp:19: undefined reference to `_imp___ZN2My5MutexD1Ev' |
Merci.