Link to home
Start Free TrialLog in
Avatar of mantish
mantish

asked on

a c++ beginner

Hello folks I'm a beginner in C++.I've been using  vc++
enterprise edition to pgm.I've been having this persistent
problems since morning so I am turning to "the experts".the prob is as follows.I have a header file & a c++ source file.I have been trying to build my proj it is creating a couple of problems. more specifically the error msg reads
inking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/String.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

OK documentation for the first one says that I have to include the function def in the header file.My question is that do I really need to do that? I have tried that but it still is giving me the same error.next Does is depend on my compiler settings. I tried changing the options but looks like even that isnt working . pl help
ASKER CERTIFIED SOLUTION
Avatar of koskia
koskia

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mantish
mantish

ASKER

thanxs a lot koskia . That was "the" perfect answer .My program
is alive & kicking .I would really appreciate if u could give me
some more info on how to run it as a window program & what are
the vars I really need to take care of.Would the sample code u provided suffice or Do I need to add more code .once again I appreciate ur help
                   regards
                                           mantish
hey mantish
glad I've helped.
actually you need to have much more code in order to get a window start and kicking, there's alot of articles and samples on the net.
I suggest you subscribe to MSDN on msdn.microsoft.com to get the basics, or buy any win32 or MFC book on the matter.

the win32 API's are all written in C, and you can use them as they are. the Microsoft Foundation Library, which is MFC, wraps many of the system calls, and gives a C++ environment.

if you wanna see a sample code for such a basic Application, run a wizard:

File/New/Project/MFC App Wizard(EXE) ... follow the instructions and voila.
if you're new to C++, I suggest you found a good book about win32 API's (the window95/98/NT system calls), and learn the core first for better understanding of what's going on.

a good book on the subject (Only C API's with no C++ classes)
is Charles Petzold's 'Programming Windows 95' - The difinitive Developer's Guide to the Windows95 API, by Microsoft Press.

as an example from the book I can give you the most simple app:
"HelloWin.CPP" -> see my next comment down below
Actually, as I see it's a much bigger program than I've rememberred it.

read some books :)
 if you'll need any help on a specific or general issues in the future, just as, I'm here.

p.s.
The code I gave you earlier is just the very beginning of the program, in order to create a window  you need much  much more.

submit your email, and I could send you some simple apps later on the day

asaf_k@automedi.com
Avatar of mantish

ASKER

Thanxs again for answering my question.