Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Linker error Code generation failed in vc++ win32 application

Posted on 2008-06-26
11
Medium Priority
?
4,301 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
Industry Leaders: 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

688 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