error LNK2001

Hi, (I saw the post on same subject but it seems to be a little different. so I'll use some word from that post!)

There is a project earlier written in VC++ 6.0.  I opened the same project in VS. NET 2005 and I am trying to compile.  The code compiles properly (with couple of warnings) but while linking I am getting unresolved external symbol errors like this:

The linker seems to have problem with seeing .obj from files in program (which are in the debug directory).

It doesn't seem that the /Zl switch or the /NODEFAULTLIB are on.

1>Linking...

1>Utm.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Zone.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Zones.obj : error LNK2019: unresolved external symbol _RTC_Shutdown referenced in function "public: static int __cdecl ZONES::LecturePhysitel(class SYChaine const &,int &,class TValMatrice2D<int> &,class COORDONNEE * &,int &,int &,class COORDONNEE *,class COORDONNEE *,double const &)" ( LecturePhysitel@ZONES@@SAHAEBVSYChaine@@AEAHAEAV $TValMatrice2D@H@@AEAPEAVCOORDONNEE@@11PEAV4@4AEBN@Z)

1>unicode.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Util.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>util2.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>UtilVC.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Thiessen.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Thornthw.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Troncon.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Troncons.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>StdAfx.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>stdtime.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Sterio.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Sychaine.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>station_neige.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>STATION_NEIGE_BD.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>stations.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>stations_neige.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>stas_met_prev.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>Station.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

1>station_hydro_bd.obj : error LNK2001: unresolved external symbol _RTC_Shutdown

[ ... ]

Here's the linker command line :

/OUT:".\Debug/HydrotelKernel.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"x64\Debug\HydrotelKernel.exe.intermediate.manifest" /DEBUG /PDB:".\Debug/HydrotelKernel.pdb" /SUBSYSTEM:CONSOLE /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

 

 




Answer this question

error LNK2001

  • cPrince

    Ok! it seems to make a difference. I now have these linking errors :

    with lib dir ordered :

    $(VCInstallDir)lib\amd64

    $(VCInstallDir)lib

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\AMD64

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\AMD64\atlmfc

    I now have these errors :

    1>Linking...

    1>AdoDatabase.obj : error LNK2001: unresolved external symbol CLSID_MSDAINITIALIZE

    1>AdoDatabase.obj : error LNK2001: unresolved external symbol IID_IDataInitialize

    1>AdoDatabase.obj : error LNK2001: unresolved external symbol IID_IDBInitialize

    1>AdoDatabase.obj : error LNK2001: unresolved external symbol CLSID_DataLinks

    1>AdoDatabase.obj : error LNK2001: unresolved external symbol IID_IDBPromptInitialize

    1>Utm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Longlat.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Mtm.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Penman.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Sterio.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Bv3c.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z) referenced in function "public: void __cdecl BV3C::SauvegardeFichierVariableInterne(class SIM_HYD &)" ( SauvegardeFichierVariableInterne@BV3C@@QEAAXAEAVSIM_HYD@@@Z)

    1>Console.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>HydrotelKernel.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Lambert.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<<char,struct std::char_traits<char> >(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (__imp_ $ 6DU $char_traits@D@std@@@std@@YAAEAV $basic_ostream@DU $char_traits@D@std@@@0@AEAV10@PEBD@Z)

    1>Bv3c.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofstream<char,struct std::char_traits<char> >(char const *,int)" (__imp_ 0 $basic_ofstream@DU $char_traits@D@std@@@std@@QEAA@PEBDH@Z) referenced in function "public: void __cdecl BV3C::SauvegardeFichierVariableInterne(class SIM_HYD &)" ( SauvegardeFichierVariableInterne@BV3C@@QEAAXAEAVSIM_HYD@@@Z)

    1>Penman.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __cdecl std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofstream<char,struct std::char_traits<char> >(char const *,int)" (__imp_ 0 $basic_ofstream@DU $char_traits@D@std@@@std@@QEAA@PEBDH@Z)

    1>ConvertionDatePicker.obj : error LNK2019: unresolved external symbol __imp_GetSystemTime referenced in function "public: static void __cdecl CConvertionDatePicker::ConvertionDateToSystemTime(char *,struct _SYSTEMTIME *)" ( ConvertionDateToSystemTime@CConvertionDatePicker@@SAXPEADPEAU_SYSTEMTIME@@@Z)

    1>Echange.obj : error LNK2019: unresolved external symbol "class CStdStr<char> __cdecl operator+(class CStdStr<char> const &,class CStdStr<char> const &)" ( H@YA AV $CStdStr@D@@AEBV0@0@Z) referenced in function "protected: int __cdecl Echange::LectEntete(struct _iobuf *,class std::vector<int,class std::allocator<int> > &)" ( LectEntete@Echange@@IEAAHPEAU_iobuf@@AEAV $vector@HV $allocator@H@std@@@std@@@Z)

    1>comsupp.lib(comutil.obj) : error LNK2001: unresolved external symbol __imp_GetLastError

    1>comsupp.lib(invkprxy.obj) : error LNK2001: unresolved external symbol __imp_GetLastError

    1>Echange.obj : error LNK2019: unresolved external symbol __imp_GetLastError referenced in function "public: bool __cdecl CStdStr<char>::Load(unsigned int,struct HINSTANCE__ *)" ( Load@ $CStdStr@D@@QEAA_NIPEAUHINSTANCE__@@@Z)

    1>fichier_utils.obj : error LNK2001: unresolved external symbol __imp_GetLastError

    1>unicode.obj : error LNK2001: unresolved external symbol __imp_GetLastError

    1>util2.obj : error LNK2001: unresolved external symbol __imp_GetLastError

    1>fichier_utils.obj : error LNK2019: unresolved external symbol __imp_LocalFree referenced in function "bool __cdecl CreateDirectoryA(char const *)" ( CreateDirectoryA@@YA_NPEBD@Z)

    1>comsupp.lib(comraise.obj) : error LNK2001: unresolved external symbol __imp_LocalFree

    1>st_meteo_hqj_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>st_meteo_prev_hq_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>ST_METEO_PREV_HQH_BD.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>st_neige_hq_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>fichier_utils.obj : error LNK2019: unresolved external symbol __imp_FormatMessageA referenced in function "bool __cdecl CreateDirectoryA(char const *)" ( CreateDirectoryA@@YA_NPEBD@Z)

    1>st_hydro_hqah_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>st_hydro_hqaj_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>st_meteo_hqh_bd.obj : error LNK2001: unresolved external symbol __imp_FormatMessageA

    1>fichier_utils.obj : error LNK2019: unresolved external symbol __imp_CreateDirectoryA referenced in function "bool __cdecl CreateDirectoryA(char const *)" ( CreateDirectoryA@@YA_NPEBD@Z)

    1>st_meteo_prev_hq_bd.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>ST_METEO_PREV_HQH_BD.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>st_neige_hq_bd.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>st_hydro_hqah_bd.obj : error LNK2019: unresolved external symbol __imp_LocalAlloc referenced in function "public: char const * __cdecl _com_error::ErrorMessage(void)const " ( ErrorMessage@_com_error@@QEBAPEBDXZ)

    1>st_hydro_hqaj_bd.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>st_meteo_hqh_bd.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>st_meteo_hqj_bd.obj : error LNK2001: unresolved external symbol __imp_LocalAlloc

    1>comsupp.lib(comutil.obj) : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>st_meteo_prev_hq_bd.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>ST_METEO_PREV_HQH_BD.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>st_neige_hq_bd.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>msvcrtd.lib(error.obj) : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>st_hydro_hqah_bd.obj : error LNK2019: unresolved external symbol __imp_lstrlenA referenced in function "public: char const * __cdecl _com_error::ErrorMessage(void)const " ( ErrorMessage@_com_error@@QEBAPEBDXZ)

    1>st_hydro_hqaj_bd.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>st_meteo_hqh_bd.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>st_meteo_hqj_bd.obj : error LNK2001: unresolved external symbol __imp_lstrlenA

    1>unicode.obj : error LNK2019: unresolved external symbol __imp_MultiByteToWideChar referenced in function "long __cdecl AnsiToUnicode(char const *,unsigned short * *)" ( AnsiToUnicode@@YAJPEBDPEAPEAG@Z)

    1>msvcrtd.lib(error.obj) : error LNK2001: unresolved external symbol __imp_MultiByteToWideChar

    1>comsupp.lib(comutil.obj) : error LNK2001: unresolved external symbol __imp_MultiByteToWideChar

    1>unicode.obj : error LNK2019: unresolved external symbol __imp_WideCharToMultiByte referenced in function "long __cdecl UnicodeToAnsi(unsigned short const *,char * *)" ( UnicodeToAnsi@@YAJPEBGPEAPEAD@Z)

    1>msvcrtd.lib(error.obj) : error LNK2001: unresolved external symbol __imp_WideCharToMultiByte

    1>comsupp.lib(comutil.obj) : error LNK2001: unresolved external symbol __imp_WideCharToMultiByte

    1>util2.obj : error LNK2019: unresolved external symbol __imp_SizeofResource referenced in function "public: bool __cdecl CStdStr<char>::Load(unsigned int,struct HINSTANCE__ *)" ( Load@ $CStdStr@D@@QEAA_NIPEAUHINSTANCE__@@@Z)

    1>util2.obj : error LNK2019: unresolved external symbol __imp_FindResourceA referenced in function "public: bool __cdecl CStdStr<char>::Load(unsigned int,struct HINSTANCE__ *)" ( Load@ $CStdStr@D@@QEAA_NIPEAUHINSTANCE__@@@Z)

    1>util2.obj : error LNK2019: unresolved external symbol __imp_GetModuleHandleA referenced in function "struct HINSTANCE__ * & __cdecl SSResourceHandle(void)" ( SSResourceHandle@@YAAEAPEAUHINSTANCE__@@XZ)

    1>msvcrtd.lib(error.obj) : error LNK2019: unresolved external symbol __imp_RaiseException referenced in function "int __cdecl DebuggerProbe(unsigned long)" ( DebuggerProbe@@YAHK@Z)

    1>msvcrtd.lib(error.obj) : error LNK2019: unresolved external symbol __imp_DebugBreak referenced in function "void __cdecl failwithmessage(void *,int,int,char const *)" ( failwithmessage@@YAXPEAXHHPEBD@Z)

    1>msvcrtd.lib(error.obj) : error LNK2019: unresolved external symbol __imp_IsDebuggerPresent referenced in function "void __cdecl failwithmessage(void *,int,int,char const *)" ( failwithmessage@@YAXPEAXHHPEBD@Z)

    1>msvcrtd.lib(gs_report.obj) : error LNK2001: unresolved external symbol __imp_IsDebuggerPresent

    1>msvcrtd.lib(error.obj) : error LNK2019: unresolved external symbol __imp_GetProcAddress referenced in function "void __cdecl _RTC_AllocaFailure(void *,struct _RTC_ALLOCA_NODE *,int)" ( _RTC_AllocaFailure@@YAXPEAXPEAU_RTC_ALLOCA_NODE@@H@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2001: unresolved external symbol __imp_GetProcAddress

    1>msvcrtd.lib(error.obj) : error LNK2019: unresolved external symbol __imp_LoadLibraryA referenced in function "void __cdecl _RTC_AllocaFailure(void *,struct _RTC_ALLOCA_NODE *,int)" ( _RTC_AllocaFailure@@YAXPEAXPEAU_RTC_ALLOCA_NODE@@H@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2001: unresolved external symbol __imp_LoadLibraryA

    1>msvcrtd.lib(crtexe.obj) : error LNK2019: unresolved external symbol __imp_Sleep referenced in function __tmainCRTStartup

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_TerminateProcess referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcess referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_UnhandledExceptionFilter referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_SetUnhandledExceptionFilter referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol RtlVirtualUnwind referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol RtlLookupFunctionEntry referenced in function __report_gsfailure

    1>msvcrtd.lib(gs_report.obj) : error LNK2019: unresolved external symbol __imp_RtlCaptureContext referenced in function __report_gsfailure

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_HeapFree referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" ( _RTC_GetSrcLine@@YAHPEAEPEA_WKPEAH1K@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_HeapAlloc referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" ( _RTC_GetSrcLine@@YAHPEAEPEA_WKPEAH1K@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_GetProcessHeap referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" ( _RTC_GetSrcLine@@YAHPEAEPEA_WKPEAH1K@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_GetModuleFileNameW referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" ( _RTC_GetSrcLine@@YAHPEAEPEA_WKPEAH1K@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_VirtualQuery referenced in function "int __cdecl _RTC_GetSrcLine(unsigned char *,wchar_t *,unsigned long,int *,wchar_t *,unsigned long)" ( _RTC_GetSrcLine@@YAHPEAEPEA_WKPEAH1K@Z)

    1>msvcrtd.lib(pdblkup.obj) : error LNK2019: unresolved external symbol __imp_FreeLibrary referenced in function "struct HINSTANCE__ * __cdecl GetPdbDll(void)" ( GetPdbDll@@YAPEAUHINSTANCE__@@XZ)

    1>msvcrtd.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_QueryPerformanceCounter referenced in function __security_init_cookie

    1>msvcrtd.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetTickCount referenced in function __security_init_cookie

    1>msvcrtd.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentThreadId referenced in function __security_init_cookie

    1>msvcrtd.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetCurrentProcessId referenced in function __security_init_cookie

    1>msvcrtd.lib(gs_support.obj) : error LNK2019: unresolved external symbol __imp_GetSystemTimeAsFileTime referenced in function __security_init_cookie

    1>comsupp.lib(invkprxy.obj) : error LNK2019: unresolved external symbol __imp_lstrlenW referenced in function "long __cdecl _com_invoke_helper(struct IDispatch *,long,unsigned short,unsigned short,void *,unsigned short const *,char *,struct IErrorInfo * *)" ( _com_invoke_helper@@YAJPEAUIDispatch@@JGGPEAXPEBGPEADPEAPEAUIErrorInfo@@@Z)

    1>.\Debug/HydrotelKernel.exe : fatal error LNK1120: 45 unresolved externals



  • Rahul Singla

    Well, it seems that the only line with libcmt.lib in it is :

    1> Processed /DISALLOWLIB:libcmt.lib

    The first line is the one i wrote first. Because the default directories weren't compiling the code, I tried to use the Microsoft Platform SDK for Windows Server 2003 R2. Yes, it is in (x64,lib).

    I tried the /ARCHIVEMEMBERS in >>Tools>>Microsoft Studio 2005 command prompt but it says that grep is not recognized as an internal or external command...



  • yanivpinhas

    I copied information for version in 'about'. This doesn't says if it is the beta 2 or release :

    Microsoft Visual Studio 2005
    Version 8.0.50727.42 (RTM.050727-4200)
    Microsoft .NET Framework
    Version 2.0.50727

    Installed Edition: Professional

    Microsoft Visual Basic 2005 77626-009-0000007-41148
    Microsoft Visual Basic 2005

    Microsoft Visual C# 2005 77626-009-0000007-41148
    Microsoft Visual C# 2005

    Microsoft Visual C++ 2005 77626-009-0000007-41148
    Microsoft Visual C++ 2005

    Microsoft Visual J# 2005 77626-009-0000007-41148
    Microsoft Visual J# 2005

    Microsoft Visual Web Developer 2005 77626-009-0000007-41148
    Microsoft Visual Web Developer 2005

    Crystal Reports AAC60-G0CSA4B-V7000AY
    Crystal Reports for Visual Studio 2005

    DirectX extensions for Visual Studio
    DirectX extensions for Visual Studio .NET



  • lbugnion

    Hum, actualy, I'm <trying> compiling in x64 on a AMD64 architechture.

    (I forgot to write in the first post that in the additionnal options (in linker) I wrote : /MACHINE:AMD64)

    For the dumpbin /HEADERS, do I only have to type it in command line (i've never used it)



  • McWhirter

    That looks like you get the x86 version. You should list $(VCInstallDir)lib\amd64 as the first line in the "library directories" for x64. The linker should then pickup msvcprtd.lib from that directory.

    -hg


  • litewoheat

    These are pretty common. You're missing some libraries. The GUIDs for OLE/DB stuff are in msdasc.lib and oledb.lib. The other things are in kernel32.lib (you can look up the function name in MSDN and look at the bottom which import library is required). Add these libraries in additional dependencies for the linker (under Input).

    That should resolve all but the operator<< errors. Not sure why these are missing. They should probably be in the C++ libraries (msvcprt(d) or libcpmt(d)). I'm too lazy now to check the headers. But: are you sure you use the VC headers first I.e. $(VCInstallDir)\include should be the first in your headers list.

    -hg


  • Jabber

    Ok, that explains the single leading underscore. As I understand you build everything with /MT. That means you should get $(VCInstallDir)\lib\amd64\libcmt.lib. In there should be a file ..\build\amd64\mt_obj\init.obj. And that in turn defines _RTC_Shutdown.

    You should use the /VERBOSE linker switch and take a look at the output.

    There should be something like:

    Found _RTC_Shutdown
    Referenced in xy.obj
    Loaded LIBCMT.lib(init.obj)

    Maybe you get some incompatible version of libcmt.lib or it's just skrewed up.

    And yes you need to run dumpbin from the command line. You can select the shortcut in Start Menu->VS 2005->Cmd Line

    -hg


  • &amp;#193;lvaro Pe&amp;#241;arrubia

    That's quite odd. Is this a x86 project _RTC_Shutdown is a function used as part of /RTC for debug runtime checks.

    The odd thing is that its mangled name has two leading underscores (it does have one only for x64 and probably for IA64).

    Anyway, you should do a full rebuild.

    Can you run dumpbin /HEADERS on one of the offending object files

    -hg


  • ebooker

    There's no "Found _RTC_Shutdown"...

    What should I do to fix it

    My lib directories are (in order in options):

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\AMD64

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib\AMD64\atlmfc

    $(VCInstallDir)lib\amd64

    $(VCInstallDir)lib



  • Eugene Katz

    At least we're getting closer ;-)

    The error suggests that the msvcprtd.lib is for X86 while you link a X64 image. BTW: which version are you using The release version should call it x64 rather than AMD64 (actually we used to call it EM64T at our shop -- Intel, that is :-) )

    Please do make sure you use the VC2005 compiler (again make sure that $(VCInstallDir)\vc\bin\amd64 precedes the SDK bin dir for binaries).

    Anyhow, can you see which msvcprtd.lib is selected Tthat's again the /VERBOSE switch with the Searching xxx.lib line.

    -hg


  • Robert Kozak

    I now get this :

    1>Linking...

    1>msvcprtd.lib(MSVCP80D.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'AMD64'

    1>Build log was saved at "file://c:\[...]\x64\Debug\BuildLog.htm"

    1>HydrotelKernel - 1 error(s), 110 warning(s)

    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

    Which is strange because I'm compiling in x64... why would x86 stuffstill be  in that context 



  • Jos Warmer

    I'm sorry I mixed that up with another thread. Depending on whether you build with /MT,/MTd,/MD or /MDd you get libcmt,libcmtd,msvcrt,msvcrtd.lib.

    Just replace with whatever option you have. But do make sure that $(VCInstallDir)lib\amd64 is the first library path. I have verified that the 2003 R2 PSDK indeed doesn't have _RTC_Shutdown. Always use language headers, support libraries and binaries from the same toolchain.

    -hg


  • TJ2007

     

    1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib:

    1> Found "__declspec(dllimport) class std::basic_ostream<char,struct std::char_traits<char> > std::cout" (__imp_ cout@std@@3V $basic_ostream@DU $char_traits@D@std@@@1@A)

    1> Referenced in Mtm.obj

    1> Referenced in Sterio.obj

    1> Referenced in Utm.obj

    1> Referenced in Console.obj

    1> Referenced in HydrotelKernel.obj

    1> Referenced in Lambert.obj

    1> Referenced in Longlat.obj

    ------

    I wrote /MACHINE:AMD64  in Additional options because I had a warning about  x64 should be in a list (which had AMD64 in it) and turned the 'target machine' to 'not set'



  • David_Lindley

    I have no idea -- it's quite odd. Are you sure that $(VCInstallDir)lib\amd64 is the first path listed in Tools->Options->Projects->Directories (x64,LIB) You should see a line "Searching " along with the path to libcmt.lib in your linkers /VERBOSE output. What path do you see

    Are you sure that your libcmt.lib in that directory has not been corrupted.

    You can use dumpbin /ARCHIVEMEMBERS to list the object files in the .lib:

    dumpbin /ARCHIVEMEMBERS libcmt.lib |grep \\init.obj -A6
    Archive member name at 41FABE: /13790 ..\build\amd64\mt_obj\init.obj
    43339F10 time/date Fri Sep 23 08:22:08 2005
    uid
    gid
    100666 mode
    1CFF size
    correct header end

    and dumpbin /LINKMEMBER to print the archive symbol table.

    dumpbin /LINKERMEMBER:1 libcmt.lib |grep RTC_Shutdown
    41FABE _RTC_Shutdown

    -hg


  • error LNK2001