Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Windows
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Martin




PostPosted: Thu Jun 12, 2003 1:23 pm   Post subject: Windows

Here's my code:
code:
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(NULL, "Testing 123...", "TEST", MB_OK);
    return 0;
}


It crashes, giving me two errors:
Quote:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals


Anyone know why? BTW, I'm using MS Visual c++ 6.0
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Thu Jun 12, 2003 2:26 pm   Post subject: (No subject)

works fine for me
using dev c++
Tony




PostPosted: Thu Jun 12, 2003 5:02 pm   Post subject: (No subject)

following code works for VC++

code:
#include <windows.h>
#include <iostream>
using namespace std;

void main()
{
    MessageBox(NULL, "Testing 123...", "TEST", MB_OK);

}
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Martin




PostPosted: Thu Jun 12, 2003 5:48 pm   Post subject: (No subject)

Yeah, I know, but that's still a console app. I just got Dev C++...I actually like it better.
Prince




PostPosted: Thu Jun 12, 2003 5:49 pm   Post subject: (No subject)

yea this works for me too... which is strange considering nuthin else has Confused
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: