Solved

Linker error Code generation failed in vc++ win32 application

Posted on 2008-06-26
11
4,167 Views
Last Modified: 2008-10-01
I have developed a glut and glui APPLICATION IN  vc++ win32 console application under windows vista......

My application was working fine.....I had used glpng library in my application to display png files...Later I replaced glpng with SOIL( simple open Image Library).. and also changed code according to that....suddenly my application is showing  the following linker error

LNK 1147 code generation failed......
any help would be greatly appreciated.......I tried to solve it from the morning......I could not solve it....
0
Comment
Question by:jsbsudha
  • 7
  • 3
11 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Be sure to add "soil.lib" to your project to resolve th elinker errors. Either add a

#pragma comment(lib,"soil.lib")

to your code or add the lib via  "Project|Add exiting Item".
0
 

Author Comment

by:jsbsudha
Comment Utility
I have added the library still i get the  same error
linker error--- code generation failed
fatal error C1900: Il mismatch between 'P1' version '20060201' and 'P2' version '20050411'
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
What are 'P1' and 'P2' in the above?
0
 

Author Comment

by:jsbsudha
Comment Utility
I have to update anything in windows vista to solve this problem......It is not building the application......I have removed the glpng and glpngd library from additional dependencies...and added soil.lib.......
0
 

Author Comment

by:jsbsudha
Comment Utility
I serached in msdn it is pass1 and pass2......I got this message in the ouput message window......surely it is not any variable
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:jsbsudha
Comment Utility
It was working fine with glpng libraray .......but now it is not building
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Do you have more than one version of Visual Studio installed?
0
 

Author Comment

by:jsbsudha
Comment Utility
NO...
0
 

Author Comment

by:jsbsudha
Comment Utility
LNK 1257 and not lnk 1147
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
Comment Utility
>>>> Linker Tools Error LNK1257 code generation failed

Actually that is only the final message after some other error(s) that were shown above in the output window.

>>>> Linker Tools Error LNK1147  invalid number specified with option 'option'

That is an error which comes if you were compiling newer sample code, e. g. for VC9 coming with VS2008 with an elder compiler (e. g. VC7.1 compiler coming with VS 2003). Then, one of the compiler options could not properly be handled as it was an option only supported by the newer compiler.

Please post all error messages of the output window, not only the final messages which actually doesn't say more than that compiling failed.


0
 

Author Comment

by:jsbsudha
Comment Utility
I have solved the error in windows XP.....by having the correct version of  SOIL.lib in my program........I downloaded SOIL.lib from its website but I replaced it with another version of SOIL.lib library without my knowledge.......

THank you very much my error is solved...................
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now