Thread: how to write programs in pelles c??

  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
    28,413
    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;
    }
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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
    28,413
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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...

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Hint: This is WHY developers spend hundreds of hours writing help files...
    Which are then simply ignored...

  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.

  14. #14
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > (Of course we never did tell them that BKC means "Between Keyboard & Chair")
    My favourite is PICNIC - Problem in chair, not in computer.
    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.

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, 10:25 PM
  5. Calling DOS based programs
    By UnclePunker in forum C++ Programming
    Replies: 3
    Last Post: 08-07-2003, 09:37 AM