-
June 1st, 2009, 06:59 AM
#1
Fatal error C1047
Hi
i am creating an application in MFC using VS 2008 using third party SDK. i am compling this
application in Debug mode it work fine. But when i am compiling this application in release mode
i get this linking error.
fatal error C1047: The object or library file '../lib/SIPEvent.lib' was created with an older compiler than other objects; rebuild old objects and libraries
thanks.
-
June 1st, 2009, 08:17 AM
#2
Re: Fatal error C1047
It means the release version of that SIPEvent.lib was not built with VS 2008. In order for your app to work properly, you need to get a new build for it, with VS 2008.
-
June 2nd, 2009, 04:14 AM
#3
Re: Fatal error C1047
Originally Posted by cilu
It means the release version of that SIPEvent.lib was not built with VS 2008. In order for your app to work properly, you need to get a new build for it, with VS 2008.
Thanks.
Actually i have Lib file and Dlls but not source code. so how i can get a new build in VS2008.
because i am new one in this.
-
June 2nd, 2009, 05:19 AM
#4
Re: Fatal error C1047
Since you don't have the source code, you cannot build it of course.
-
June 2nd, 2009, 05:32 AM
#5
Re: Fatal error C1047
Originally Posted by cilu
Since you don't have the source code, you cannot build it of course.
Thanks Cilu
-
September 8th, 2009, 01:15 PM
#6
Re: Fatal error C1047
Hi Cilu,
I have the same issue where I got an SDK lib (no DLL) from MSVC 2005 Professional,
and I have to link this lib statically with my code to create a ABC.DLL
under MSVC 2008 Professional.
...and one website suggested that
to change settings on:
C/C++ > Optimization > "Whole Program Optimization" from "/GL" to "No".
Then, it compiled and built properly.
Then, I have an ABCTest.exe program that links with this ABC.DLL.
It first asked for msvcr90.dll, and msvc*90.dll.
I provided all of those, and it ended up a runtime error.
Any idea ?
Best,
Oscar
-
September 8th, 2009, 01:52 PM
#7
Re: Fatal error C1047
Originally Posted by Warning C1047
C1047 is caused when object files or libraries built with /LTCG are linked together, but where those object files or libraries are built with different versions of the Visual C++ toolset.
Try removing /LTGC.
-
September 8th, 2009, 02:08 PM
#8
Re: Fatal error C1047
Removing \LTCG in MSVC 2005 SDK.lib build ?
I don't have the source code for it.
-Oscar
-
September 8th, 2009, 02:12 PM
#9
Re: Fatal error C1047
You do not need to same version .LIB to use in your application.
Assume for example, you have DLL and LIB file which was built using VC8 (or say VC6). You still can use it in VC8, VC9, CV10.
You have also mentioned that you can successfully build in Debug, but not in Release. That means, there must be problem with compiler/linker optimization. In Project properties, try removing 'Link time code generation', and then rebuild.
Also, you did not mention if .LIB is static library, or the DLL is with it.
-
September 8th, 2009, 02:18 PM
#10
Re: Fatal error C1047
Hello,
My case is a little bit different from the first person who posted this.
My SDK.lib (MSVC 2005) is a static lib, and there is NO SDK.dll come with it.
Under MSVC 2008, I was able to build ABC.dll in both debug and release
if I have:
C/C++ > Optimization > "Whole Program Optimization" set to "No".
Thanks,
Oscar
-
September 8th, 2009, 02:22 PM
#11
Re: Fatal error C1047
C/C++ > Optimization > "Whole Program Optimization" set to "No".
That does not remove /LTCG. In General look at the last option named 'Whole Program Optimization.
-
September 8th, 2009, 02:26 PM
#12
Re: Fatal error C1047
I am confused!
- '../lib/SIPEvent.lib'
- SDK.LIB, SDK.DLL
- ABC.DL
Please explain! which of these are Static libs?
-
September 8th, 2009, 02:37 PM
#13
Re: Fatal error C1047
Sorry, you just need to read from Sept 8th, and ignore all post before Sept 8th.
1) ../lib/SIPEvent.lib is from someone else's post. (not mine !!!)
2) SDK.LIB (SDK.DLL never exists)
I don't have source code for this. Built from MSVC 2005.
3) ABC.DLL that statically links with SDK.LIB
(Built from MSVC 2008, and I have source code)
4) ABCTest.exe that links with ABC.LIB and runs with ABC.DLL
(Built from MSVC 2008, and I have source code)
-
September 8th, 2009, 02:47 PM
#14
Re: Fatal error C1047
I infer from your reply:
- EXE links to ABC.LIB only, and no other libs.
- ABC.DLL statically links with SDK.LIB
- ../lib/SIPEvent.lib' - linked in ABC.DLL or the EXE? Or Both??
Don't fiddle with VC runtime library settings. Restore them!
- Is your DLL generated successfully?
- Are all .LIBs Release Builds?
- No service pack issues of VC8 with ABC.DLL and your EXE?
- Did not fiddle with Manifest settings?
-
September 8th, 2009, 03:51 PM
#15
Re: Fatal error C1047
Hello,
../lib/SIPEvent.lib' - linked in ABC.DLL or the EXE? Or Both??
I don't use SIPEvent.lib at all. It's not mine, and I don't use it.
It's a matter from some other post earlier.
Don't fiddle with VC runtime library settings. Restore them!
Is your DLL generated successfully?
YES
Are all .LIBs Release Builds?
SDK.lib is Release, and ABC.lib and ABC.dll are Debug.
ABCTest.exe is Debug.
No service pack issues of VC8 with ABC.DLL and your EXE?
Don't know.
Did not fiddle with Manifest settings?
Not sure. I am using embeded Manifest file, and
it has a reference to both msvc80 and msvc90 DLL(s).
Does it make sense ?
Thanks,
Oscar
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|