how to compile a console application with wxwidgets?H
Hi,
I have configured codeblocks with wxwidgets and works but i try to make an application in mode console dont work... what's going on wrong?
Code:
#include <iostream>
#include <wx/string.h>
#include <wx/utils.h>
using namespace std;
int main()
{
cout << "Hello world!" << endl;
wxString str1 = wxT("Linux");
wxString str2 = wxT("Operating");
wxString str3 = wxT("System");
wxString str;
str = str1 + wxT(" ") + str2 + wxT(" ") + str3;
wxPuts(str);
wxPrintf(wxGetHomeDir());
long mem = wxGetFreeMemory().ToLong();
wxPrintf(wxT("Memory: %ld\n"), mem);
return 0;
}
Re: how to compile a console application with wxwidgets?H
What do you mean mode console? What errors are you getting? I don't see any problems
Re: how to compile a console application with wxwidgets?H
now works !!!
Solution:
Global compiler Setting-> Linker setting->other linker options
add: -lwxmsw28
Thanks everone ! :)
Re: how to compile a console application with wxwidgets?H
Quote:
Originally Posted by
ninja9578
What do you mean mode console? What errors are you getting? I don't see any problems
a CLI application
thanks !!
Re: how to compile a console application with wxwidgets?H
Oh, that's not a compiler error, it's a linker one.
Re: how to compile a console application with wxwidgets?H
If you are new to wxWidgets then head over to
http://wxdsgn.sourceforge.net/
download the IDE with visual designer( its free) , everything is setup ready to go , try the same code in this IDE , it take care of all header and linker issues for you , codeblocks is a Good IDE , however more meat for exprienced developers ,
further http://www.3dbuzz.com have some great tutorials on wxWidgets and C++
Re: how to compile a console application with wxwidgets?H
There is a good forum here: http://forums.wxwidgets.org/
I used to use wxWidgets a lot, but I stopped and wrote my own library after I saw something that really irked me with their implementation, but unless you are doing complex library stuff, you don't need to worry about that.