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)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
best to get in the habit of using TEXT instead of C strings early!
As for the errors... What compiler/IDE?
ASKER
thank u so much guys. i solve the problem with ur sayings. Now it is working.
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"?