c++ - Linker problem on VS2005 with VC++ -
Here is the scenario:
Platform: VS 2005 and Language VC ++
The situation is: only 1 assembly is CMPW32, there are 2 projects in it: 1 is a DLL project given the name of CMPD 32 and the other is a driver which they call the XP project, they share the same debug folder under the main assembly folder We do. I am able to export some functions successfully from DLL. The driver project reaches one of these export jobs (first of all, I do not think if I need functions export to use them for projects in the same assembly, then I can only include header files and my thoughts I can use.)
The following are some lines of code from some files that may be useful for analyzing your problem:
// main.cpp file from the driver project that is the driver. Exe #pragma to generate a comment (Lib, "winmm.lib") #include & lt; CM.h & gt; Include #include "conio.h" #include "CMF.h" #CBI_F _T ("c: \\ CannedMessages.en-US") int_tmain (int argc, TCHAR * argv []) {CMM Myobodel; CMF :: Read (CANNED_MESSAGES_FILE, IOBZ MODEL); Getch (); } //CMM.h file #ifndef C_M_M #define C_M_M #include "CMD.h" #include "cmc.h" #include "CM.h" #define _C_M_DLL #include "CMP.h" class CM_DLL_API CMM {// Some code here ...} //CMF.h #ifndef C_M_F #define C_M_F #include "CMM.h" #define _C_M_DLL #include "CMP.h" class CM_DLL_API CMF {// Something code here ...} // CMP. H #ifndef C_M_P #define C_M_P #include "CMD.h" #define C_M_B_F _T ("CannedMessages.") #ifdef _C_M_DLL #define CM_DLL_API __declspec (dllexport) #else #define CM_DLL_API __declspec (dllimport) #endif extern "C" { // Error on creating solution: error 13 error LNK2019: unresolved external symbol "public: __thiscall CMM :: ~ CMM (zero) "(? 1CMM @@ QAE @ XZ) function referenced in _wmain main.obj
Error 15 Fatal Error LNK1120: 2 Unsolved Built C: \" Here are some places I "Projects \ CMPW32 \ Debug \ Driver.exe
Please note: If I choose to build only CMP, the W32 DLL project is no error and the CMPW32.dll file gets generated in the debug folder with the right functions are generated . However, there seems to be some linking problem which is very clear and I do not know what's going on. I have included every necessary file and entered the required .lib in the input of "Project Settings". The roads have also been properly installed.
It would be really helpful if someone could help me with it. Please know if additional information is needed or not.
Thank you, Varen
The CPM source files of the CMM class in the Driver.exe project Does not include, chances are CMM.cpp.
or
You have declared a disaster for CMM, your H. Forgot to apply the class in the file (CMMH) and applying it to .cpp file (cmc cpp).
Comments
Post a Comment