×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Help a beginner with unresolved error problem (windows prog)

Help a beginner with unresolved error problem (windows prog)

Help a beginner with unresolved error problem (windows prog)

(OP)
Ok, I have searched and read the posts about running a windows program using borlands c++ (I use version 5.02).  The post are a little beyond me...  Here is my program:
#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <windowsx.h>

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance,
                   LPSTR lpcmdline, int ncmdshow)
{
MessageBox(NULL,"THERE CAN BE ONLY ONE!!",
           "MY FIRST WINDOWS PROGRAM THAT WORKS!",
           MB_OK | MB_ICONEXCLAMATION);
return(0);
}

Can someone in an easy to understand way explain how to fix the linker problem, because I keep getting "unresolved _main " in cox32 or something...  I would LOVE it if you could explain in full how to fix this... (ps: I am new to C++ lang, but I am not a computer moron).  Thanks.

RE: Help a beginner with unresolved error problem (windows prog)

You must create at the first a Win32 type project. Afetr it add your .cpp to your project. If you create the file at the first, the compiller add it on a project what by default is a console application project(typical DOS program) whose main function is not WinMain bu main

John Fill
ivfmd@mail.md

RE: Help a beginner with unresolved error problem (windows prog)

I believe the defaults for 5.02 were for either DOS or Windows Console. If you want to compile in Win32 you will need to change your switches on the compiler commands.

James P. Cottingham
www.ivcusa.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close