Jump to content
  • Advertisement
Sign in to follow this  
_moagstar_

Visual Studio 2005 - Outputting Pre-Processed Code causes linker error

This topic is 4001 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am using the compiler option /P to output the preprocessed code to a file. However whenever I use this I get a LIB : fatal error LNK1181: cannot open input file Because the .obj is not being generated. Does anyone have any idea how I can get rid of this linker error - I want to be able to generate the processed code but I don't want the project to fail. Any Ideas?

Share this post


Link to post
Share on other sites
Advertisement
/P causes the code to not be compiled. If you want both the preprocessed file and the OBJ to be generated in the same build (not sure why you'd want this, but okay), simply compile it twice with different options, or compile the preprocessed file.

Share this post


Link to post
Share on other sites
Thanks for your rapid response :)

I'm only interested in the pre-processed file. I have a seperate project that uses the c pre-processor (with the help of boost/preprocessor) to generate some stubbed code for me from a set of headers, and then I'm going to use the pre-processed file as an input to another project, but I don't want the project that creates the stubbed code to fail, because otherwise it's going to compile everytime I build, I only need it to compile when the headers change.

It sounds like your solution would work, but I've just realised I can just run a custom build on the file using cl /P /C, which will not invoke the linker at all, so the project won't fail. Thanks for your advice though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!