• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Autodesk ObjectARX

    Reply
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Linker Error

    1683 Views, 12 Replies
    04-15-2012 07:02 AM

    I'm converting from VS2008/Acad 2010 to VS2010/Acad2013 and I think I have most of my settings correct but I'm getting the following error which I don't understand:

     

    Error 1 error C1900: Il mismatch between 'P1' version '20081201' and 'P2' version '20080116' C:\MVS.2010.For.2013\EMD_2013(32-64)\EMD13_Acad\LINK

    "C:\MVS.2010.For.2013\EMD_2013(32-64)" is the path to my projects.  "EMD13_Acad is the project on which I'm working.

     

    Any help would be appreciated.

     

    Thanks,

    Ed

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    Re: Linker Error

    04-15-2012 09:41 AM in reply to: EMD1954

    Did you Rebuild All?

    --
    Owen Wengerd
    ManuSoft
    Please use plain text.
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Re: Linker Error

    04-15-2012 12:00 PM in reply to: EMD1954

    Yes, I'm doing batch rebuild (Win32 and x64).  I have 2 library files which I placed on the correct path and they are found when I rebuild the project file but now I'm getting an error saying that it "cannot open file 'mfc100u.lib'.  It's in C\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\lib" and my library path is:

     

    $(VCInstallDir)lib
    $(VCInstallDir)atlmfc\lib
    $(WindowsSdkDir)lib
    $(FrameworkSDKDir)lib

     

    I'm also getting:

     

    Warning 19 warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored C:\MVS.2010.For.2013\EMD_2013(32-64)\EMD13_Acad\EMD13_Common_Dict(32).lib(_Dict_Last.obj).

    ---and---

    Warning 20 warning LNK4229: invalid directive '/FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=0' encountered; ignored C:\MVS.2010.For.2013\EMD_2013(32-64)\EMD13_Acad\EMD13_Common_Dict(32).lib(_Dict_Last.obj)

    "EMD13_Common_Dict(32).lib" is my library file when compiling for Win32.  I get the same warning with my file for x64 "EMD13_Common_Dict(64).lib"

     

    I think my basic settings for the library files (Win32 Project with "static library", "precompiled headers" and "add common header files for mfc") are correct - they compile without any errors or warnings but I must have something wrong in the settings for the project files.

     

    Finally, I didn't try to migrate from VS2008.  I created new projects from VS2010 and just added my .cpp and .h files into them.

     

    Thanks again,

    Ed

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    Re: Linker Error

    04-15-2012 01:39 PM in reply to: EMD1954

    You may have other problems, but it sounds like your library files are built with a different version of the linker than the one you're using now.

    --
    Owen Wengerd
    ManuSoft
    Please use plain text.
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Re: Linker Error

    04-15-2012 04:54 PM in reply to: EMD1954

    I've deleted everything and started from scratch.  I set my properties as follows:

     

    For both the libraries and the project:

    Configuration Properties / General / Whole Program Optimization / Use LTCG

    C / C++ / Optimization / Whole Program Optimization / Yes

    Librarian / General / LTCH / Yes

     

    For the project:

    And in the project Linker / General / Enable Incremental Linking / No

    Linker / Optimization / Link Time Code Generation / Use LTCG

     

    Now I've got it down to:  "Error 3 error C1047: The object or library file 'Win32\3DFaceGrid.obj' was created with an older compiler than other objects; rebuild old objects and libraries C:\MVS.2010.For.2013\EMD_2013(32-64)\EMD13_Acad\LINK"

     

    I don't know how my file 3DFaceGrid.cpp compiled to 3DFaceGrid.obj with an "older compiler" because I did a rebuild all and everything recompiled.

     

    I get the same errors in x64.  Is there somewhere I can find how to set all of my configuration properties?

     

    Any ideas?

     

    Ed

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    Re: Linker Error

    04-15-2012 05:24 PM in reply to: EMD1954

    Make sure you're not starting Visual Studio with /useenv or some other obscure mode. Verify that your platform toolset setting is correct in each project. Have you installed any add-ons? Have you rebooted?

    --
    Owen Wengerd
    ManuSoft
    Please use plain text.
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Re: Linker Error

    04-15-2012 06:09 PM in reply to: EMD1954

    Owen,

     

    I shut down and restarted.

    I deleted all of my output subdirectories.

    I rebuilt everything.

    Same error message.

     

    My VC2010 shortcut is:  "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe"

     

    My only add-on is the ObjectARX wizard 2012

     

    I checked my $(IncludePath) macro for the library files and it has "C:\Program Files\Microsoft Visual Studio 10.0\VC\include".

     

    I checked my $(IncludePath) macro for the project and it has "C:\Program Files\Microsoft Visual Studio 9.0\VC\include"

     

    I don't know how it ever got 9.0 - all I can think of is that it copied (some of) my settings from VS2008 when I installed VS2010.  As I said previously, I did not migrate my old projects - I started from scratch and created new ones in VC2010 keeping only my personal .cpp and .h files.  Having found this "include path" bust, how do I go about changing the $(IncludePath)? 

     

    Maybe that should do it.

     

    Thanks for your time and energy,

    Ed

     

    PS.  I did not uninstall VC2008 nor do I want to.

     

    Please use plain text.
    Mentor
    Posts: 239
    Registered: ‎08-06-2002

    Re: Linker Error

    04-15-2012 08:48 PM in reply to: EMD1954

    You didn't say whether your platform toolset setting is correct, so I'd guess not.

    --
    Owen Wengerd
    ManuSoft
    Please use plain text.
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Re: Linker Error

    04-16-2012 05:08 PM in reply to: owenwengerd

    Yes, I missed that one.

     

    It's now set to v100.   And I set #define_WIN32_WINNT 0x0501 in stdafx.h My include path is now:

     

    c:\Program Files\Microsoft Visual Studio 10.0\VC\VC\include
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include
    c:\Program Files\Microsoft SDK's\Windows\v7.0\incl

     

    but I'm getting the following errors:

     

      StdAfx.cpp
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin.h(4060): error C2061: syntax error : identifier 'PSCROLLBARINFO'
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin2.inl(362): error C2039: 'NotifyWinEvent' : is not a member of '`global namespace''
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin2.inl(362): error C2660: 'CWnd::NotifyWinEvent' : function does not take 4 arguments
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(184): error C2065: 'PSCROLLBARINFO' : undeclared identifier
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(184): error C2146: syntax error : missing ')' before identifier 'pScrollInfo'
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(184): error C2761: 'BOOL CScrollBar::GetScrollBarInfo(void) const' : member function redeclaration not allowed
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(184): error C2059: syntax error : ')'
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(185): error C2143: syntax error : missing ';' before '{'
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxwin4.inl(185): error C2447: '{' : missing function header (old-style formal list?)
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcmn3.inl(20): error C2065: 'CCM_SETWINDOWTHEME' : undeclared identifier
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcmn3.inl(23): error C2065: 'CCM_SETWINDOWTHEME' : undeclared identifier
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcmn3.inl(29): error C2065: 'CCM_SETWINDOWTHEME' : undeclared identifier
    c:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\afxcmn3.inl(46): error C2065: 'CCM_SETWINDOWTHEME' : undeclared identifier

     

    I'm lost.  Sorry to be a pain,

    Ed



     

    Please use plain text.
    Active Contributor
    Posts: 46
    Registered: ‎11-19-2006

    Re: Linker Error

    04-17-2012 06:34 PM in reply to: EMD1954

    In case anyone was following this thread, here's what I did to fix everything (at least it's working so far!):

     

    1. I deleted the StdAfx.h file that the wizard generated when I created the new arx project.
    2. I copied the StdAfx.h file from the ARXDBG sample (which was significantly different than the one created by the ObjectARX Wizard 2012).
    3. I added the "includes" I needed from the acadStdafx.h file in ARXDBG sample.
    4. I added my local "includes"

     

    Then I only had one error which I corrected by adding the following lines in stdafx.h:

     

    #ifndef

    _WIN32_WINNT

    #define

    _WIN32_WINNT 0x0601

    #endif

     

    FYI, the wizard generated file defined it as 0x0400.  I previously had errors that said I needed it to be 0x0501.  I found in the SDK V7.0A that it should be 0x0601.

     

    Works fine.  Hope someone finds this useful,

    Ed

     

    PS.  Owen, thanks for all of your suggestions.

     

     

    Please use plain text.