This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR C318

Hi,
This is srikanth daggumati.Could u pls help how to
compile (example Text1.c) from command prompt.I
checked the Help but error C318 is coming.
And also i want to see the output of the Text1.c in
simulator it self.Could u pls help me in this....
Iam attaching the FILE(Text1.c) in this mail pls go
through it and let me knew..

regard's
srikanth

/* Text1.c */
#include<stdio.h>
main()
{
printf("sri");
}

Parents
  • product:C51&8051 Development Tools
    ERROR C318 : Can't open the file Text1.c

    Hi,
    When iam Debugging from command prompt the above mentioned error is coming.I typed C51 Text1.c in the command prompt.
    And second one is how can i see the out put of Text1.c(printf statements) in the uVision IDE?.
    Could u pls help in this??

    regard's
    srikanth

Reply
  • product:C51&8051 Development Tools
    ERROR C318 : Can't open the file Text1.c

    Hi,
    When iam Debugging from command prompt the above mentioned error is coming.I typed C51 Text1.c in the command prompt.
    And second one is how can i see the out put of Text1.c(printf statements) in the uVision IDE?.
    Could u pls help in this??

    regard's
    srikanth

Children
  • "ERROR C318 : Can't open the file Text1.c

    I typed C51 Text1.c in the command prompt."


    You are talking about the Windows C:> prompt ("DOS box"), aren't you?

    So what happens if you type "DIR Text1.c"?

    "And second one is how can i see the out put of Text1.c (printf statements) in the uVision IDE?."

    The first step is to build the project.
    If you haven't built the project yet, you will certainly get no output!

    You need to start by reading the uVision Getting Started Guide, and working through the example projects in it.
    The examples include a simple "Hello, world" program that does exactly what you require!

  • Hi,
    After typing DIR Text1.c the following....

    C:\Keil\C51\BIN>dir text1.c
    Volume in drive C has no label.
    Volume Serial Number is 70F6-02D7

    Directory of C:\Keil\C51\BIN

    12/15/2005 06:11 PM 49 Text1.c
    1 File(s) 49 bytes
    0 Dir(s) 2,564,460,544 bytes free

    regard's
    srikanth

  • show the results of both commands:

    C:\Keil\C51\BIN>dir text1.c
    C:\Keil\C51\BIN>c51 text1.c

    BTW: It is not generally a good idea to have your work files in the same folder as your tool executables!

  • C:\Keil\C51\BIN>dir Text1.c
    Volume in drive C has no label.
    Volume Serial Number is 70F6-02D7

    Directory of C:\Keil\C51\BIN

    12/15/2005 06:11 PM 49 Text1.c
    1 File(s) 49 bytes
    0 Dir(s) 2,512,453,632 bytes free

    C:\Keil\C51\BIN>c51 Text1.c

    C51 COMPILER V8.01 - SN: Eval Version
    COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2005
    *** WARNING C500 IN LINE 1 OF TEXT1.C: LICENSE ERROR (R225: REGISTRATION FILE 'T
    OOLS.INI' NOT FOUND)


    C51 COMPILATION COMPLETE. 1 WARNING(S), 0 ERROR(S)

  • That's not the error C318 that you originally reported, is it?!

    So what's cchanged?

  • Yes That's not the Error what i mentioned first,At first i given Command out side Keil as follow's


    C:\>c51 Text1.c

    C51 COMPILER V8.01 - SN: Eval Version
    COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2005
    *** ERROR C318 OF Text1.c: can't open file 'Text1.c'

    C51 COMPILATION COMPLETE. 0 WARNING(S), 1 ERROR(S)

  • So How can Rectify the current ERROR

  • You need to remember that two things are needed to find a file:
    1. Its name (eg, Text1.c), and
    2. Its location, or "path" (eg, C:\Keil\C51\BIN)

    If you run the compiler from within uVision, the IDE takes care of this for you.
    Is there any particular reason why you're not using uVision?

  • HI,
    There is NO special reason why iam not using uVision.Just to knew how to Compile and Debugg through Prompt.
    In IDE uVision i can't able to find the printf statements.In Output Window after DEBUGGING I Can See only as follows

    Running with Code Size Limit: 2K
    Load "C:\\Keil\\C51\\Examples\\project1"

  • Stop.

    Read the uVision Getting Started Guide, and work through the example projects in it.

    This will give you a proper introductions to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep-end!