Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have not been abled to compiled a C source, even the simplest one.
Following are the steps I have taken: I've downloaded eclipse-cpp-indigo-SR1-incubation-win32 and installed mingw-get-inst-20110530.exe on my Windows XP 32 bits. I have setted the C:\MinGW\bin in Windows Path.
I am getting this error while trying to include
stdio.h
:
XML
Multiple markers at this line
    - Unresolved inclusion: <stdio.h>
    - fatal error: stdio.h: No such file or
     directory

Do I have to include something in
Properties, C/C++ Build, Settings, MinGW C++ Linker
? I didn't wrote anything in Libraries.
Posted

There should be some setting for "Include Directories". This setting will inform the compiler where files like stdio.h are located. Try looking through all of the Settings and see if you can find one called Include Directories.
 
Share this answer
 
My Includes is filled with
C:\MinGW\include
and my Libraries with
"C:\MinGW\lib"
. I am guessing that this is enought. But I am still getting the same message when I try to use
stdio.h
but I am getting no erros if I only use stm.h. I am sure I am losing some detail but I don't know what. Shall I include some library in
C/C++ Build>>Sttings>>GCC C++ Compiler >>Includes
? I am ingaing that it's not necessary because MingW already contain GCC. If I am wrong, whatelse I must include in?
 
Share this answer
 
Comments
Christian Graus 13-Feb-12 14:48pm    
See how this is a question, and you pushed the button labelled 'answer' ? Don't do that. Post a comment or edit your post to add detail.
Are you able to compile some code from the command line with gcc or g++ ?

Write a simple file :

#include <stdio.h>

int main()
{
 return 0;
}
</stdio.h>


save file as "test.c"
(not tested, as far as I remember, this should work)
and from the command line :
gcc text.c


What is the output of that ?
 
Share this answer
 
Hello. I haven't been ablt to compile from the command line.
I typed C:\MinGW\bin>gcc C:\Temp\test.c in the command line and I got this return:
VB
C:\Temp\test.c:1:19: fatal error: stdio.h: No such file or directory
compilation terminated.
. In the User Variable of Windows XP I wrote c:\MinGW\bin; in the Path variable. It is sounding to me that I have done something wrong during instalation. I did it from mingw-get-inst-20110530.exe.
 
Share this answer
 
Comments
Richard MacCutchan 23-Feb-12 9:06am    
You need to add the -I option to your command to tell the compiler where the header files are stored. Assuming they are in c:\MinGW\include then your command would be:

gcc -Ic:\MinGW\include C:\Temp\test.c
.
However it would be easier if you added C:\MinGW\bin to your PATH environment variable, and created an INCLUDE variable that contains c:\MinGW\include. You could then do your actual compiling from the directory that contains the source code. Try looking at the gcc help for further information.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900