CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2011
    Posts
    3

    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;
    }

  2. #2
    Join Date
    Jan 2009
    Posts
    1,689

    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

  3. #3
    Join Date
    Jan 2011
    Posts
    3

    Resolved 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 !

  4. #4
    Join Date
    Jan 2011
    Posts
    3

    Re: how to compile a console application with wxwidgets?H

    Quote Originally Posted by ninja9578 View Post
    What do you mean mode console? What errors are you getting? I don't see any problems
    a CLI application

    thanks !!

  5. #5
    Join Date
    Jan 2009
    Posts
    1,689

    Re: how to compile a console application with wxwidgets?H

    Oh, that's not a compiler error, it's a linker one.

  6. #6
    Join Date
    Mar 2010
    Location
    Melbourne Australia
    Posts
    454

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

  7. #7
    Join Date
    Jan 2009
    Posts
    1,689

    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.

  8. #8
    Join Date
    Feb 2011
    Posts
    1

    Kasiko

    Kasika hello friend, I see you already solved your problem but I'm still the same, and took 1 ½ months searching for a solution and still nothing I can compile programs in graphical mode but not in console mode, not as I contact you or at least he would know how to compile programs in console mode from the beginning as a manual from 0, now I'm using codeblocks (without MinGW), MinGW (latest version) and WxPack

    I would like to know how to install each of them
    for example in two ways Mingw one that says, previous packet or the latest updates
    and how you set the wxwidgets:

    mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1

    sorry for my english, i'm peruvian

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured