Linker Error

Linker Error

EMD1954
Advocate Advocate
6,619 Views
12 Replies
Message 1 of 13

Linker Error

EMD1954
Advocate
Advocate

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

0 Likes
6,620 Views
12 Replies
Replies (12)
Message 2 of 13

owenwengerd
Advisor
Advisor

Did you Rebuild All?

--
Owen Wengerd
ManuSoft
0 Likes
Message 3 of 13

EMD1954
Advocate
Advocate

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

0 Likes
Message 4 of 13

owenwengerd
Advisor
Advisor

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
0 Likes
Message 5 of 13

EMD1954
Advocate
Advocate

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

0 Likes
Message 6 of 13

owenwengerd
Advisor
Advisor

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
0 Likes
Message 7 of 13

EMD1954
Advocate
Advocate

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.

 

0 Likes
Message 8 of 13

owenwengerd
Advisor
Advisor

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

--
Owen Wengerd
ManuSoft
0 Likes
Message 9 of 13

EMD1954
Advocate
Advocate

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



 

0 Likes
Message 10 of 13

EMD1954
Advocate
Advocate

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.

 

 

0 Likes
Message 11 of 13

Alexander.Rivilis
Mentor
Mentor

You can transform project created with ObjectARX Wizard 2012 in order to work with AutoCAD 2013 with help of Visual Teefy (http://adndevblog.typepad.com/autocad/2012/04/migrating-objectarx-and-net-plug-ins-to-autocad-2013.h...)

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 12 of 13

EMD1954
Advocate
Advocate

Thank you.  This confirmed everything I've done on the first project I migrated.  Now I will use this video and the Visual Teefy module to migrate all of the others.

 

Thanks again,

Ed

0 Likes
Message 13 of 13

Anonymous
Not applicable

Thanks EMD1954.

I  imported a project from VS 2005 today and immediately encountered similar errors to yours. I altered the offending #define to 0x0501 but no cure. Then when I read all the other fixes that others recommended to you my heart sank. I like others have waded through thick VS undergrowth attempting to fix intractable problems - but because of the beauty and power of VS C++ I always persevere.

But then you mentioned the 0x0601 , and when I made the change - voila ! It worked .

 

Thanks to you and the other advisers,

 

David Kelly

 

P.S Don't go away I may need your help again before long 🙂

0 Likes