Like Tree5Likes
  • 2 Post By CommonTater
  • 1 Post By rags_to_riches
  • 1 Post By CommonTater
  • 1 Post By Salem

how to write programs in pelles c??

This is a discussion on how to write programs in pelles c?? within the C Programming forums, part of the General Programming Boards category; how to write programs in pelles c?? i wrote it: Code: #include<stdio.h> int main() { printf("hye"); } but it is ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    50

    Angry how to write programs in pelles c??

    how to write programs in pelles c??
    i wrote it:
    Code:
    #include<stdio.h>
    
    int main()
    {
    	printf("hye");
     
    }
    but it is showing error during execution:
    Building a.exe.
    POLINK: error: Unresolved external symbol '_WinMain@16'.
    POLINK: fatal error: 1 unresolved external(s).
    *** Error code: 1 ***

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Ok... you need to read the help file...

    Open POIDE... click help -> contents -> Contents tab -> Integrated Environment -> POIDE

    And start reading.

    One of Pelles C's greatest strengths is that is probably the best documented programming setup on the web.

  3. #3
    Registered User
    Join Date
    Apr 2011
    Posts
    50
    omg! please help i am fed up with error report every time i try to execute it. is getch(); not allowed in pelles c. please write a sample code to show an example. also when working in a project, the compile button seems to be inactive. plz tell the error in this code, i cant find it. also i didnt find any sample code in the help menu.
    Code:
    #include<stdio.h>
    #include<conio.h>
    int main(void)
    {
    	printf("hi hjk");
                 getch();
    	 
    }

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,973
    Quote Originally Posted by Abhas
    omg! please help i am fed up with error report every time i try to execute it. is getch(); not allowed in pelles c.
    So don't use it. You probably don't need it in the first place. For example:
    Code:
    #include<stdio.h>
    
    int main(void)
    {
        printf("hi hjk");
        return 0;
    }
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Apr 2011
    Posts
    50
    Quote Originally Posted by laserlight View Post
    So don't use it. You probably don't need it in the first place. For example:
    Code:
    #include<stdio.h>
    
    int main(void)
    {
        printf("hi hjk");
        return 0;
    }
    even this is seemingly not working.
    getting this error:
    Building a.exe.
    Invalid command: "L"
    C:\Documents and Settings\Machine\output\a.obj(1): Error in script -- aborting creation process
    *** Error code: 1 ***
    Done.

    what to do?
    plz tell.

    i think i am doing some fundamental error.

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,973
    Well, that's strange. This program is actually identical (except for the string) to the one in your first post because the return 0; is optional in main given that Pelles C supports C99, yet you get a different error message.

    I suggest that you start afresh with a new project/source file.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    Apr 2011
    Posts
    50
    hey at last i worked, but i dont know what was my mistake earlier.
    one more question : in a project, i made only the .c file. but the compile button isnt working. wat to do?

    n lots of thanks to both of u.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Oh for crying out loud.... READ THE HELP FILE....

    In the Pelles C helpfile ...
    click the CONTENTS tab...
    now click "integrated environment..."
    now click "POIDE integrated environment..."
    now click "Your first project..."


    While you're in there read the REST of the POIDE section...

    Hint: This is WHY developers spend hundreds of hours writing help files...
    Salem and rags_to_riches like this.

  9. #9
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,641
    Hint: This is WHY developers spend hundreds of hours writing help files...
    Which are then simply ignored...
    CommonTater likes this.

  10. #10
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by rags_to_riches View Post
    Which are then simply ignored...
    Really....

    Before retiring, my crew and I used to "forget" these half page notes on people's desks...
    Resolving BKC errors

    1) RTFS .... Read the effing screen.
    2) RTFH .... Read the effing help file.
    3) RTFM .... Read the effing manual.

    Then if the problem persists...

    4) Spend $50.00 per hour having it fixed.
    It was really amazing how the rate of stupid calls fell off after that.

    (Of course we never did tell them that BKC means "Between Keyboard & Chair")
    Last edited by CommonTater; 04-10-2011 at 08:59 AM.

  11. #11
    Registered User
    Join Date
    Aug 2010
    Posts
    15
    getch() and kbhit() and probably more are defined with underscores in pelles, check the header file conio.h

    _getch() instead of getch(), etc.

  12. #12
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by deepcode View Post
    getch() and kbhit() and probably more are defined with underscores in pelles, check the header file conio.h

    _getch() instead of getch(), etc.
    You will find that throughout Pelles library. Any non-standard function is preceded by an underscore, and noted as such in the help file.

  13. #13
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by laserlight View Post
    Well, that's strange. This program is actually identical (except for the string) to the one in your first post because the return 0; is optional in main given that Pelles C supports C99, yet you get a different error message.

    I suggest that you start afresh with a new project/source file.
    Hi Lase...
    Pelles IDE requires you to set up a project, which sets many parameters in the compile/link chain as a starting point and sets the appropriate include and library paths for your project. As part of this process it also asks the user for the project type, name and a root path. If the user selects a project type that is inappropriate for his work, it's going to screw up royally... If no project is started you won't be able to compile the project because no tool chain has been established...

    Here's what the dialog looks like....

    Attachment 10492

    For most of the stuff we see here... click Win32 Console Program then type in a name and click OK... it's a lot easier than it looks.
    Last edited by CommonTater; 04-10-2011 at 07:34 PM.
    Salem likes this.

  14. #14
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    > (Of course we never did tell them that BKC means "Between Keyboard & Chair")
    My favourite is PICNIC - Problem in chair, not in computer.
    rags_to_riches likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can I easily write multi-core programs in C?
    By advancedk in forum C Programming
    Replies: 2
    Last Post: 08-13-2008, 05:22 PM
  2. read write lock in C#
    By George2 in forum C# Programming
    Replies: 0
    Last Post: 04-16-2008, 08:49 AM
  3. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  4. Some humour...
    By Stan100 in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-06-2003, 09:25 PM
  5. Calling DOS based programs
    By UnclePunker in forum C++ Programming
    Replies: 3
    Last Post: 08-07-2003, 09:37 AM

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