Help!

This is a discussion on Help! within the C Programming forums, part of the General Programming Boards category; I am new to this whole thing ah i have recently tried to compile different programs, but for some reason ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    Exclamation Help!

    I am new to this whole thing
    ah
    i have recently tried to compile different programs, but for some
    reason i get the error saying that #include <stdio.h> is invalid
    here is how i have been going about compiling them:
    i go into the command prompt, change my dir to the location of bcc32.exe, then i type in bcc32.exe -c prog name.
    i think i am just going about it wrong
    could someone please post a reply telling me how to compile a program using Borland 5.5?
    please
    by the way: i know that it is not a programming error because the code i try to compile is from a book, so it not wrong
    please

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Re: Help!

    Originally posted by programmerham

    by the way: i know that it is not a programming error because the code i try to compile is from a book, so it not wrong
    please
    Who says it isn't? Maybe the book uses a different compiler?
    Try compiling a code wich you know for sure is a specificly code
    writtin in and for the Borland 5.5 compiler.

    And don't use titles like 'help!' or 'read this!'.

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    This should compile your program:
    >>bcc32.exe myprog.c
    providing myprog.c is in the current directory.

    Maybe you haven't setup the Borland config files correctly, in which case, read this.

    If you still have troubles, post your code anyway.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    Registered User
    Join Date
    Feb 2003
    Posts
    8
    The compiler came with the book
    that is why i am pretty sure it is not the program

  5. #5
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    Thumbs down

    here is what i got even after doing cfg:
    C:\Documents and Settings\All Users\Documents\Programming\Bin>bcc32.exe FIG02_01
    .c
    Borland C++ 5.5 for Win32 Copyright (c) 1993, 2000 Borland
    FIG02_01.C:
    Warning W8065 FIG02_01.C 7: Call to function 'printf' with no prototype in funct
    ion main
    Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    what does that mean? this is a program from the book, but here is code:
    /* Fig. 2.1: fig02_01.c
    A first program in C */


    int main( void )
    {
    printf( "Welcome to C!\n" );

    return 0;
    }
    it is very simple, that why i picked it
    but i don't know what wrong

  6. #6
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    Add the bold stuff to your program :-)
    Code:
    /* Fig. 2.1: fig02_01.c
    A first program in C */
    #include <stdio.h>
    
    int main( void )
    {
      printf( "Welcome to C!\n" );
    
      return 0;
    }
    *Cela*

  7. #7
    Registered User
    Join Date
    Feb 2003
    Posts
    8
    what that do?

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by Cela
    Add the bold stuff to your program :-)
    Code:
    /* Fig. 2.1: fig02_01.c
    A first program in C */
    #include <stdio.h>
    
    int main( void )
    {
      printf( "Welcome to C!\n" );
    
      return 0;
    }
    +

    what that do?
    =

    duh....

  9. #9
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by programmerham
    what that do?
    Adding this:
    >#include <stdio.h>
    includes that file into your program. It contains various function prototypes and a few other things, and will enable your particular code to compile. This header file is probably the most commonly used in C programming, chances are you'll always need to #include it.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  10. #10
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    Unhappy sorry

    The code i posted was one that i edited, and i thought you were just saying that i needed to make that bold, misunderstanding.
    i know you should include that, but it said it wrong, so i took out and saved then tried again and never reverted it back
    sorry

  11. #11
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    .obj? win32 application error? ARGH!

    Aight
    stuff is compiling now, but i try to compile the very simple first part of my programming project for biology, and it make a program.obj file in my bin folder
    i searched for a program.exe, and found a app that wont' run do to some win32 thingy majig
    please help

  12. #12
    Registered User
    Join Date
    Feb 2003
    Posts
    8

    Thumbs up YAYYYYYYYY!!!!!!!!!!!

    IT WORKS
    thanks guys/gals for all your help
    i got the main structure working!
    it compiles runs and all of the such
    THANKS so much
    i will post any questions i got knowing i will get help


    The board moderator can delete this thread, i done with it

  13. #13
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>The board moderator can delete this thread, i done with it
    We don't do that on this board, threads are left for others to learn from.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21