Share via


cl.exe can't find stdlib.h on a 64 bit machine?

Question

Wednesday, August 10, 2011 8:56 PM

I recently got a new 64 bit computer at work (previously running 32 bit Win7) and tried compiling an older legacy project on the new machine.  The build system is a strange amalgam of cygwin, gnu make and visual studio's compiler.  When I run the build process, I get the following error:

 

C:\develop\company\project\src\world.h(3) : fatal error C1083: Cannot open include file: 'stdlib.h': No such file or directory

 

It is using the cl.exe located at: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin , so why can't it find the stdlib located at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include ?  I have done all the same things to set it up as I did on my last computer (as well os my co-workers') but it gives me this very perplexing error.  Is this perhaps an issue of trying to build a 32- bit app on a 64-bit machine?

 

All replies (2)

Friday, August 12, 2011 7:50 AM âś…Answered

Hi,

 

Based on my knowledge,  you can build a 32-bit application on a 64-bit machine.  According to your description, it seems that there are some issue about your development environment。 Please follow these steps to fix your issue:

1, Right-click the project node and select properties.

2, Select on VC++ Directories and check all of the option is correct.  If VC++ Directories is incorrect. Please try to fix them or reset your setting.

3 Create a new sample which include the header file and check whether or not the VC++ path has correct.

 

I hope my suggestion can help you to resolve your issue.

 

Best Regards,

Rob

Rob Pan [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Friday, August 12, 2011 3:48 PM | 1 vote

Thanks for your reply.  The problem ended up being something else, but you got me looking in the right area and I eventually got it fixed.  It turns out that the include directories were supposed to be exported to the $PATH environment variable as part of the build process, but for some reason weren't.  I just manually added them to the compiler flags and it seemed to work.  Thanks again.