Link to home
Start Free TrialLog in
Avatar of sercanparlak
sercanparlak

asked on

PROBLEM

hi i wanted to write my first program, that i guess u know "hello world".
i wrote this in dos application there was no problem.
when i tried to write this in windows equivalent i had some problems.

my program:


#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE        
          hPrevInstance, PSTR szCmdLine, int iCmdShow)

{
   messagebox (NULL, TEXT("Hello World"), TEXT
              ("HelloMSG"),0);
   return 0;
}


errors:

LIBCD.lib(crt0.obj) : error LNK2001: unresolved external
                      symbol _main
debug/deneme.exe    : fatal error LNK1120: 1 unresolved
                      externals
deneme.exe - 2 error(s), 0 warning(s)
ASKER CERTIFIED SOLUTION
Avatar of efn
efn

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 aib_42
aib_42

Also, that system call is MessageBox, not messagebox. Using "messagebox" will probably give you more linker errors.

One more thing:
What is TEXT("")? Why would you need such a construct to make/use strings while you can make perfectly good C-strings by just using the "quotes"?
TEXT("") conditionally marks the literal to use unicode conversion
best to get in the habit of using TEXT instead of C strings early!

As for the errors...   What compiler/IDE?
Avatar of sercanparlak

ASKER

thank u so much guys. i solve the problem with ur sayings. Now it is working.