Hi Guys
Have any of you tried running your C programs using DOSBOX in WINDOWS 7,I have installed it lately but I keep getting the error "unable to open include file "stdio.h" for all the header files.Please Help.
Thank YOU
Printable View
Hi Guys
Have any of you tried running your C programs using DOSBOX in WINDOWS 7,I have installed it lately but I keep getting the error "unable to open include file "stdio.h" for all the header files.Please Help.
Thank YOU
Obviously, the header file is not where your compiler is looking for it. I haven't used DOSBOX, but if you open a console window, from inside DOSBOX, you should be able to find the header files, and then get your compiler looking in the right place.
Rather than go through all this, you might want to consider a better set up (imo):
smorgasbordet - Pelles C
Has version just for Window 7, if you like.
Does DosBox should support C.Anyways I will use pelles C.Could you still please tell me what the problem is?
Not really, because the question is too vague. What do you mean by "running [our] C programs"? If it can't find stdio.h, it wont compile, so you can't run your program. Do you mean can't compile your program? If so, what is your compiler? Do you have the compiler/projects settings using the right include directories (check your manual/docs)? Does the compiler have read access to the header files? There are too many variables here for us to say what the problem is, beyond it's "unable to open include file "stdio.h", but you already know that.
PellesC gives error.Do I have to learn things all over again?Code:#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
getch();
}
Find out where stdio.h is located in DOSBOX, and make sure that Pelles C knows where to find that. Unlike many *NIX systems, I don't think there's a standard location for header files that every compiler can just assume. It depends on the IDE/compiler. Once you find where stdio.h is located, check your Pelles C docs for how to specify include file locations.
Oh yeah, and void main is a no-no.
Pelles C has a *native* C compiler for Windows 7, including both 32 bit and 64 bit versions.
So why are you using DOSBOX still, in Windows 7?
Check it in the header files, but I don't believe conio.h is supported (it is not supported on most versions of C).
And, as mentioned above, you have to know where DOSBOX is taking you, and let your compiler know where to look for it's files. That will be true with any compiler, no matter what.
I thought I mentioned the fact that I used Pelles C.The code is not working in Pelles C not dosbox.
@livid:
I already answered this:
@Quzah:Quote:
Check it in the header files, but I don't believe conio.h is supported (it is not supported on most versions of C).
Yeah, I have a fav DOS based game also. Hard on the wrists to play it, but the original Prince of Persia game (using just the single tinny PC speaker), is great.
In one part, you have to drink from one of the potions before you. Drink the wrong one, and you die - of course. Drink the other wrong one, and the screen instantly changes to upside down and backwards.
I defy anyone to run and leap through the gauntlet of troubles facing them, (and sword fighting, of course), all upside down and backwards. :p :p :p :D What a blast!
So... why even mention DOSBOX? All you're doing is confusing people.
From the DOSBOX tutorial...
This is NOT a compiler and you should not be using it to run a compiler... it is an emulator that lets you run 8 bit DOS programs from the early 1980s. With anything more recent, you simply do not need it.Quote:
DOSBox is an emulator that recreates a MS-DOS compatible environment (complete with Sound, Input, Graphics and even basic networking). This environment is complete enough to run many classic MS-DOS games completely unmodified.
It is totally unnecessary with programs written in Pelles C... you can simply open a console window in Win7 and run your programs... Type WIN+R then type CMD and click OK... instant console window.
Pelles C does support conio as part of it's private headers collection. It's not part of C99.
Unless you've been messing with your include paths and library paths it should work just fine.
Do the following EXACTLY...
Open Pelles C IDEClose and re-open the IDE
Click the X in the project tree to close all projects
Click on Tools in the menu
Click on Options
Click on Folders
Click the Defaults button
Now open your project...
Click on Project in the menu
Click on Project Options
Click on Folders
Click the Defaults button
You should now be able to include conio.h without errors.
While you're at it... READ THE HELP FILE... Pelle did an amazing job of documenting his compiler and libraries...
I think the reason he wanted to use DOSBOX was because he was using that fossil Turbo C. Now he's trying to use Pelles C with Turbo C code and failing miserably, because his Turbo C code is using non-standard Borland libraries.
He should be able to move from turbo c to pelles pretty easily... Most of the same headers and libraries exist in both... The thing is he's going to have to use the 32 bit versions that come with PellesC and not the 16 bit versions that came with the dinosaur...