Solved

Linker error Code generation failed in vc++ win32 application

Posted on 2008-06-26
11
4,238 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
11 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 21877525
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
ID: 21877591
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
ID: 21877623
What are 'P1' and 'P2' in the above?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jsbsudha
ID: 21877641
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
ID: 21877649
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
 

Author Comment

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

Expert Comment

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

Author Comment

by:jsbsudha
ID: 21877671
NO...
0
 

Author Comment

by:jsbsudha
ID: 21877705
LNK 1257 and not lnk 1147
0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 500 total points
ID: 21888163
>>>> 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
ID: 21889732
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

739 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