View previous topic :: View next topic |
Author |
Message |
TOMER1 Guest
|
fatal: unable to open file 'proj0003.def' |
Posted: Wed Feb 04, 2009 8:57 am |
|
|
Hallow friends
I have a problem with my C
I have tried to run the simplest program
Code: | #include <stdio.h>
void main()
{
int first,second;
printf("first");
scanf("%d",&first);
printf("second");
scanf("%d",&second);
printf("sum %d/n",first+second);
} |
After that I press compile and make project (1 error) and build project (1 error) and finally I press run
I receive a message fatal: unable to open file 'proj0003.def' |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 04, 2009 9:19 am |
|
|
You _may_ be able to ignore 'warnings', but an error, says that something is wrong. In this case, you have not defined what processor the code is for, so how can the compiler generate code?...
Remember this is a compiler to produce a program to run in a specific chip, not a compiler to produce code to run inside an 'OS', which already knows how fast the chip is running, and where th serial port 'is' etc..
A minimum program, needs:
1) A processor definition - normally done by including the processor file at the head of the code.
2) Fuse definitions to say how to configure this processor.
3) Clock definition, so the compiler knows how fast the processor is running, and can adjust timings for the serial etc., to match.
4) A serial definition to say what pins on the chip to use for I/O.
5) Your code added _after_ these, will compile and run.
Best Wishes |
|
|
TOMER1 Guest
|
|
Posted: Wed Feb 04, 2009 10:42 am |
|
|
I am sorry but I don't understand way I can't run the program inside an operating system?
I want that before I build a program into chip to run some codes in my compute, how I can do this? |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 04, 2009 10:58 am |
|
|
Go to a different board....
This is a board for _CCS C_, which is an _embedded_ C, running basically on PIC processors. Answers here, are _only for this compiler_.
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Feb 04, 2009 11:06 am |
|
|
Are you running this program on a PIC microcontroller or on a PC? The PIC chips don't usually use an operating system as they often have only a few hundred bytes of memory.
This BBS is for the CCS C compiler for PIC chips running without an operating system. If you have a different processor or use an OS you will need to ask your questions elsewhere. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 04, 2009 11:13 am |
|
|
Do you have the CCS compiler ? If so, this link tells how to simulate
your program without running it in hardware.
http://www.ccsinfo.com/forum/viewtopic.php?t=36805
If you have TurboC or MSVC++, then you're on the wrong forum. |
|
|
|