What cause compiling error: LNK 1257 : code generation failed?
-
יום רביעי 11 נובמבר 2009 21:32Hi Everyone,
I am wondering what cases the error, 'fatal error LNK 1257: code generation failed"? I created a C++ static library using VS2008 and also prepared a main routine to test it. It seems works just fine. So I copied the code to another directory so that I can add other C++ libraries and start building my application based on this code. Strangely, this time this error occured (while I am compiling the same code, not even adding anything yet), I follw a suggestion I found on this Forum: logoff and re-start the system. It did not n=help. Any explanations? suggestions? Thanks for your help.
Tom Lin
כל התגובות
-
יום שישי 13 נובמבר 2009 05:58Hi Tom,
Have you installed the Visual Studio SP1? if not you could download it here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=27673c47-b3b5-4c67-bd99-84e525b5ce61&DisplayLang=en
Sincerely,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. -
יום רביעי 18 נובמבר 2009 03:48
Hello,
How are you? Is your problem resolved? May I know whether the above suggestions helped you?
Thanks,
Wesley
Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. -
יום רביעי 18 נובמבר 2009 13:54
Thanks Wesley for your suggestion. Sorry for the late reply, I just come back from Chicago yesterday. I can't remember that I download it or not and will certainly do it today. I will let you know. Have a great day.
Tom Lin
-
יום רביעי 18 נובמבר 2009 14:43Hi Wesley,
I just tried it after downloading VS SP1. The problem persists. After the download, I re-started my computer. Do I need to do 'installation'? I was not prompted to do so. Thanks.
Tom Lin -
יום רביעי 18 נובמבר 2009 23:38
I've seen this error when one or more of my static libraries were compiled with an older version of the compiler. I'm not sure why the version is so dependent, but I've been able to fix it by recompiling all of the libraries I'm using. My guess, in this case, is it's one of the other libraries you're trying to use since your test program works with just the single library.
There is also a bug posted in connect on it:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101576
I think it may have something to do with how the code is optimized, but I don't know why that would make any difference either. You could try taking out one lib at a time until it works so you can identify the culprit.
Tom -
יום רביעי 07 מרץ 2012 09:41I also faced same issue , after installing VS 2005 SP2 , issue resolved.