Hello industry veterans,
I am a junior in college, embarking on my first summer internship program, and I am above my head. The company I'm working on has acquired a colossal application from another company, which is gradually expanding and modifying it since the beginning of the 90s. The solution contains more than 200,000 lines of code that apply to more than 300 files. The entire solution was allegedly written in accordance with ANSI-C ++ standards. The code is almost completely undocumented, and most of it looks like hieroglyphs to me. Ultimately, my task is to port this code to embedded Linux. At the moment, my task is to simply build it using Visual Studio 2008 in Windows XP.
Today I am facing linker errors like this one:
libcmtd.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR90D.dll)
I understand that this often happens when different projects within a solution are compiled using different runtime libraries . There are 6 projects in my solution. 4 of them were configured to compile using a multi-threaded debug runtime library (/ MDd), one of which was configured to compile using a multi-threaded debug library (/ MTd), and one of them was configured to compile using a multi-threaded time library DLL (/ MD). The first thing I tried after receiving this error message was to change / MTd and / MD to / MDd so that everything compiles with the same runtime libraries. Unfortunately, this led to the following error in afx.h:
fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
, , . " MFC" " " โ " " โ "" " MFC DLL". , :
dataPropertySheet.obj : error LNK2019: unresolved external symbol "public: __thiscall CResizableSheet::CResizableSheet(unsigned short const *,class CWnd *,unsigned int)" (??0CResizableSheet@@QAE@PBGPAVCWnd@@I@Z) referenced in function "public: __thiscall CdataPropertySheet::CdataPropertySheet(unsigned short const *,class CWnd *,unsigned int)" (??0CdataPropertySheet@@QAE@PBGPAVCWnd@@I@Z)
ResizableLib.lib(ResizablePage.obj) : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWnd::Create(char const *,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)" (?Create@CWnd@@UAEHPBD0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z)
MSDN LNK2001 LNK2019 , . , , . . , , !
, , #includes. #ifdef #define, , , , , . , , , , . , .
, , , . , , , , . , , , , , .
, . Doxygen, , , , .
:
?
:
a.)
)
. - ? ? ?
, ,
-Alex-