Link errors while building VC6 project using VC++ Toolkit 2003

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Leith Bade

    #1

    Link errors while building VC6 project using VC++ Toolkit 2003

    I have been trying to use the new Visual C++ Toolkit 2003 with the VC6 IDE
    I set up the executable, inlcude, and library directories to point to the new compilers
    I had to fix a few errors in the MFC6 <afxtempl.h> to get it to compile with the better standards confomance (mainly omitted typename, and lazyness with specialized templates - using BASE_CLASS & TYPE instead of CObList & CObList*)
    Now I get some strange linker errors, and I don't know much about linker errors :-

    Here's my linker output (for debug)
    --------------------Configuration: WinCPUID - Win32 Debug-------------------
    Linking..
    Microsoft (R) Incremental Linker Version 7.10.305
    Copyright (C) Microsoft Corporation. All rights reserved
    /subsystem:windo ws /incremental:yes "/pdb:Debug/WinCPUID.pdb" /debug /machine:I386 "/out:Debug/WinCPUID.exe"
    ".\Debug\Clouds .obj"
    ".\Debug\CPUDat a.obj"
    ".\Debug\Custom PropSheet.obj"
    ".\Debug\file_v er.obj"
    ".\Debug\PropPa geAbout.obj"
    ".\Debug\PropPa geCPUID.obj"
    ".\Debug\PropPa geInfo.obj"
    ".\Debug\StdAfx .obj"
    ".\Debug\WinCPU ID.obj"
    ".\Debug\WinCPU ID.res"
    PropPageAbout.o bj : error LNK2001: unresolved external symbol __RTC_CheckEs
    PropPageCPUID.o bj : error LNK2001: unresolved external symbol __RTC_CheckEs
    PropPageInfo.ob j : error LNK2001: unresolved external symbol __RTC_CheckEs
    WinCPUID.obj : error LNK2001: unresolved external symbol __RTC_CheckEs
    Clouds.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "public: __thiscall CCloudsCtrl::CC loudsCtrl(void) " (??0CCloudsCtrl @@QAE@XZ
    CPUData.obj : error LNK2001: unresolved external symbol __RTC_CheckEs
    CustomPropSheet .obj : error LNK2001: unresolved external symbol __RTC_CheckEs
    file_ver.obj : error LNK2001: unresolved external symbol __RTC_CheckEs
    PropPageAbout.o bj : error LNK2001: unresolved external symbol __RTC_Shutdow
    PropPageCPUID.o bj : error LNK2001: unresolved external symbol __RTC_Shutdow
    PropPageInfo.ob j : error LNK2001: unresolved external symbol __RTC_Shutdow
    WinCPUID.obj : error LNK2001: unresolved external symbol __RTC_Shutdow
    Clouds.obj : error LNK2001: unresolved external symbol __RTC_Shutdow
    CPUData.obj : error LNK2019: unresolved external symbol __RTC_Shutdown referenced in function "public: int __thiscall CCPUData::Updat e(void)" (?Update@CCPUDa ta@@QAEHXZ
    CustomPropSheet .obj : error LNK2001: unresolved external symbol __RTC_Shutdow
    file_ver.obj : error LNK2001: unresolved external symbol __RTC_Shutdow
    PropPageAbout.o bj : error LNK2001: unresolved external symbol __RTC_InitBas
    PropPageCPUID.o bj : error LNK2001: unresolved external symbol __RTC_InitBas
    PropPageInfo.ob j : error LNK2001: unresolved external symbol __RTC_InitBas
    WinCPUID.obj : error LNK2001: unresolved external symbol __RTC_InitBas
    Clouds.obj : error LNK2001: unresolved external symbol __RTC_InitBas
    CPUData.obj : error LNK2001: unresolved external symbol __RTC_InitBas
    CustomPropSheet .obj : error LNK2001: unresolved external symbol __RTC_InitBas
    file_ver.obj : error LNK2001: unresolved external symbol __RTC_InitBas
    PropPageAbout.o bj : error LNK2019: unresolved external symbol @_RTC_CheckStac kVars@8 referenced in function "public: __thiscall CPropPageAbout: :CPropPageAbout (void)" (??0CPropPageAb out@@QAE@XZ
    PropPageCPUID.o bj : error LNK2001: unresolved external symbol @_RTC_CheckStac kVars@
    WinCPUID.obj : error LNK2001: unresolved external symbol @_RTC_CheckStac kVars@
    Clouds.obj : error LNK2019: unresolved external symbol @_RTC_CheckStac kVars@8 referenced in function "protected: virtual void __thiscall CCloudsCtrl::Pr eSubclassWindow (void)" (?PreSubclassWi ndow@CCloudsCtr l@@MAEXXZ
    CPUData.obj : error LNK2001: unresolved external symbol @_RTC_CheckStac kVars@
    CustomPropSheet .obj : error LNK2001: unresolved external symbol @_RTC_CheckStac kVars@
    file_ver.obj : error LNK2019: unresolved external symbol @_RTC_CheckStac kVars@8 referenced in function "public: __thiscall CFileVersionInf o::CFileVersion Info(void)" (??0CFileVersio nInfo@@QAE@XZ
    Clouds.obj : error LNK2019: unresolved external symbol __ftol2 referenced in function "protected: void __thiscall CCloudsCtrl::Ge neratePlasma(in t * const)" (?GeneratePlasm a@CCloudsCtrl@@ IAEXQAH@Z
    file_ver.obj : error LNK2019: unresolved external symbol _VerQueryValueA @16 referenced in function "public: int __thiscall CFileVersionInf o::ReadVersionI nfo(class CString const &)" (?ReadVersionIn fo@CFileVersion Info@@QAEHABVCS tring@@@Z)
    file_ver.obj : error LNK2019: unresolved external symbol _GetFileVersion InfoA@16 referenced in function "public: int __thiscall CFileVersionInf o::ReadVersionI nfo(class CString const &)" (?ReadVersionIn fo@CFileVersion Info@@QAEHABVCS tring@@@Z)
    file_ver.obj : error LNK2019: unresolved external symbol _GetFileVersion InfoSizeA@8 referenced in function "public: int __thiscall CFileVersionInf o::ReadVersionI nfo(class CString const &)" (?ReadVersionIn fo@CFileVersion Info@@QAEHABVCS tring@@@Z)
    Debug/WinCPUID.exe : fatal error LNK1120: 8 unresolved externals
    Error executing link.exe.

    For Release:
    --------------------Configuration: WinCPUID - Win32 Release--------------------
    Linking...
    Clouds.obj : error LNK2019: unresolved external symbol __ftol2 referenced in function "protected: int __thiscall CCloudsCtrl::Ge tRandomValue(in t,int)" (?GetRandomValu e@CCloudsCtrl@@ IAEHHH@Z)
    Clouds.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) referenced in function "public: virtual __thiscall CCloudsCtrl::~C CloudsCtrl(void )" (??1CCloudsCtrl @@UAE@XZ)
    WinCPUID.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
    Clouds.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) referenced in function "protected: virtual void __thiscall CCloudsCtrl::Pr eSubclassWindow (void)" (?PreSubclassWi ndow@CCloudsCtr l@@MA
    EXXZ)
    file_ver.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
    WinCPUID.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
    Release/WinCPUID.exe : fatal error LNK1120: 3 unresolved externals
    Error executing link.exe.

    How can I fix these?

    ---
    Leith Bade
    Project Admin
    WinCPUID
    leithalweapons@ msn.com
    wincpuid.source forge.net
  • David Lowndes

    #2
    Re: Link errors while building VC6 project using VC++ Toolkit 2003

    >I have been trying to use the new Visual C++ Toolkit 2003 with the VC6 IDE.[color=blue]
    >I set up the executable, inlcude, and library directories to point to the new compilers.[/color]
    [color=blue]
    >Now I get some strange linker errors, and I don't know much about linker errors :-(
    >
    >Here's my linker output (for debug):
    >..
    >PropPageAbout. obj : error LNK2001: unresolved external symbol __RTC_CheckEsp[/color]

    Looks like you might still be linking with the V6 libraries.

    Dave

    Comment

    • alixia

      #3
      Re: Link errors while building VC6 project using VC++ Toolkit 2003


      I´m still having the problem:
      error LNK2019: unresolved external symbol __ftol2

      I´ve proved to put the next lines of code in my c file:

      #if (_MSC_VER >= 1300) && (WINVER < 0x0500)
      //VC7 or later, building with pre-VC7 runtime libraries
      extern "C" long _ftol( double ); //defined by VC6 C libs
      extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource );
      }
      #endif

      but now the problem is the string "C", it isn´t recognized by the
      compiler maybe. I´ve installed the microsotf c++ 2003 toolkit.
      I don´t understand.



      --
      alixia
      ------------------------------------------------------------------------
      Posted via http://www.codecomments.com
      ------------------------------------------------------------------------

      Comment

      • Jochen Kalmbach [MVP]

        #4
        Re: Link errors while building VC6 project using VC++ Toolkit 2003

        Hi alixia!
        [color=blue]
        > #if (_MSC_VER >= 1300) && (WINVER < 0x0500)
        > //VC7 or later, building with pre-VC7 runtime libraries
        > extern "C" long _ftol( double ); //defined by VC6 C libs
        > extern "C" long _ftol2( double dblSource ) { return _ftol( dblSource );
        > }
        > #endif
        >
        > but now the problem is the string "C", it isn´t recognized by the
        > compiler maybe. I´ve installed the microsotf c++ 2003 toolkit.
        > I don´t understand.[/color]

        Why do you query WINVER?
        If it is only depended on the MS-VC-Version you should only query _MSC_VER!

        But to comply with C-files, you should change it to:


        #if _MSC_VER >= 1300
        //VC7 or later, building with pre-VC7 runtime libraries
        #ifdef __cplusplus
        extern "C" {
        #endif
        long _ftol( double ); //defined by VC6 C libs
        long _ftol2( double dblSource ) { return _ftol( dblSource );
        #ifdef __cplusplus
        }
        #endif
        #endif


        --
        Greetings
        Jochen

        My blog about Win32 and .NET

        Comment

        Working...