News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Can't find header files

Started by Magnum, March 07, 2013, 01:24:19 PM

Previous topic - Next topic

Magnum

I am trying to compile some C code using M.S. cl.exe.

It says it can't find a header file, so I get it.

Then it can't find another header file.

Up to 10 header files so far.

On and on it goes. Ad infinitum

I thought about copying every header file into the include directory.

Is there an easier way ?

Thanks.

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

anta40

Why don't you use VS Native Tools Command Prompt?
It's way easier, because all the required include and lib directories are already configured.

CommonTater

Quote from: Magnum on March 07, 2013, 01:24:19 PM
I am trying to compile some C code using M.S. cl.exe.
It says it can't find a header file, so I get it.

And after that you will discover a whole list of missing libraries....

C and C++ require sets of headers that describe functions in libraries.  While there is not a one to one correlation between headers and libs, there absolutely is a one to one correlation between functions prototyped in headers and functions existing in libraries.

If you download and install theWindows SDK you will have a full set of both headers and libraries for MSVC++ version 9.0 (2008).  This will give you headers in two places... inside the C++ install and inside the SDK install... all you have to do is open a command window compose two path-like strings for the environment...

set INCLUDE=<path to sdk headers>;<path to c++ headers>
set LIB=<path to sdk libs>;<path to c++ libs>

Then, provided you use the same command window, you can run CL and it will know where to find things.

But... if this is plain C code, why not install Pelles C and compile with that? 




MichaelW

Or another way, assuming that you are not using in IDE, is to compile with a batch file, in your working directory, that sets up a workable environment so the tools can find the necessary files, for example:

set file="test"
set PATH=C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin;%PATH%
set INCLUDE=C:\Program Files\Microsoft SDK\include;C:\Program Files\Microsoft Visual C++ Toolkit 2003\include;%INCLUDE%
set LIB=C:\Program Files\Microsoft SDK\lib;C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib;%LIB%

cl /W4 %file%.c

pause

Well Microsoft, here's another nice mess you've gotten us into.

Magnum

Thanks for all the help.

I installed Poide but it can find the server.

I guess that is where the projects are stored.

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org