I've downloaded and compiled wxWindows using VC++ 2008 Express. Also am able to compile/link the Calculator example program (haven't tried the others yet).
Now I want to begin writing my own program. So I searched google for tutorials to help get starte. None of them contain main(), and neither does the Calculator example program. I started a new console project and added the Hello World code from one of the tutorials. Since the tutorials don't have main() I deleted main() from my project. It compiles but link gets error
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
D:\dvlp\simple\Debug\simple.exe : fatal error LNK1120: 1 unresolved externals
So, what am I missing ?
// main.h
class MyApp : public wxApp
{
public:
virtual bool OnInit();
};
// simple.h
class Simple : public wxFrame
{
public:
Simple(const wxString& title);
};
// main.cpp
#include "main.h"
#include "simple.h"
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
Simple *simple = new Simple(wxT("Simple"));
simple->Show(true);
return true;
}
// simple.cpp
#include "simple.h"
Simple::Simple(const wxString& title)
: wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(250, 150))
{
Centre();
}
The project contains these libraries, which I copied from another example project.
wxmsw28d_core.lib wxbase28d.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib wxregexd.lib wxexpatd.lib winmm.lib comctl32.lib rpcrt4.lib wsock32.lib odbc32.lib