How to compile win32gui with gcc/g++

Help
Qiuwg
2004-09-20
2013-04-15
  • Qiuwg

    Qiuwg - 2004-09-20

    I installed Dev-cpp 4.9.9, its inbuild compiler is gcc/g++ 3.3.1, I add path of gcc's bin directory.

    when use your build tool (exe) v1.4.1b, is raises too much errors. I try to build the example, still cannot success.

    not everybody install vs.net 2003, doesn't it?

    could you detailed it in readme file, I use win2k system?

     
    • John Torjo

      John Torjo - 2004-09-20

      Wow! Bloodshed has released a new version ;)
      (the one I have at home is 4.9.8.0 - with gcc 3.2)

      I recently re-ported it to gcc3.2 - win32gui version v1.4.1b. In case you don't already have this, please get it.

      If you do have it - I'm in the process of downloading the latest Dev-Cpp (w/ gcc3.3.1). I will check to see if there are any errors - when compiling.

      Also, note that when building, for GCC, you need to  add some additional includes. In my case, they are:
      C:/Dev-Cpp/include
      C:/Dev-Cpp/include/c++
      C:/Dev-Cpp/include/c++/mingw32
      C:/Dev-Cpp/include/c++/backward

      I assume in your case, they should be similar to :
      C:/Dev-Cpp/include
      C:/Dev-Cpp/include/c++/3.3.1
      C:/Dev-Cpp/include/c++/3.3.1/mingw32
      C:/Dev-Cpp/include/c++/3.3.1/backward

      Best,
      John

       
    • Qiuwg

      Qiuwg - 2004-09-21

      Again Question : About compile and link problem ?

      Thanks very much for your reply, I added the path according to  your suggestions, but still seemed something is wrong.

      First, I try to use dev-cpp 4.9.9.0, which inbuild gcc/g++ 3.3.1, but I build it failure....; Reason is something wrong in gcc's head files or something unexpected?

      Second, I generated static-link-library project in vc6 (I like use this in win2k system), added all src files in win32gui/src/ directory, opened RTTI option of the project and made some trivial changes in some of the cpp files. select intel c++ compiler v7.1 as compiler. The build information are listed in follow (I think intel compiler is good enough to support c++ template).

      It is an execellent project, But is there anyone give me a thorough scheme about how to compile it in win2k.

      I don't like install .NET Framework, it's too big for me, and I'm not sure how to redistribute the program finished in that Framework, the target machine also need to install that framework? or just need mfcxx.dll?

      --------------------Configuration: vc6_proj - Win32 Debug--------------------

      Compiling...
      dialog.cpp
      F:\win32gui-lib-v1.4.1b\win32gui\src\dialog.cpp(73): error: no instance of function template "std::for_each" matches the argument list
                  argument types are: (win32::gui::wnd_iterator<win32::gui::window_base>, win32::gui::wnd_iterator<win32::gui::splitter>, void (win32::gui::wnd<win32::gui::splitter> &))
            std::for_each( find_wnd_range<splitter>(this,search_children), wnd_iterator<splitter>(), do_compute_split_siblings);
            ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\dialog.cpp(194): error: class "win32::gui::window_base" has no member "update_layout"
                parent<view_frame>()->update_layout();
                                      ^
      mdi_frame.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\dialog.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui\src\mdi_frame.cpp(115): error: class "win32::gui::window_base" has no member "rename"
                        top_parent<mdi_frame>()->rename( child, child->text() );
                                                 ^
      menu_cmd_manipulator_wnd.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\mdi_frame.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui/shared_ptr/shared_ptr.hpp(193): error: cannot convert pointer to base class "win32::gui::window_base" to pointer to derived class "win32::gui::toolbar" -- base class is virtual
            wnd_shared_ptr(wnd_shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
                                                            ^
                detected during:
                  instantiation of "win32::gui::wnd_shared_ptr<T>::wnd_shared_ptr(const win32::gui::wnd_shared_ptr<Y> &) [with T=win32::gui::toolbar, Y=win32::gui::window_base]" at line 215 of "F:\win32gui-lib-v1.4.1b\win32gui/window.hpp"
                  instantiation of "win32::gui::wnd<impl>::wnd(const win32::gui::wnd<other_impl> &) [with impl=win32::gui::toolbar, other_impl=win32::gui::window_base]"
      splitter.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\menu_cmd_manipulator_wnd.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui\src\splitter.cpp(88): error: no suitable user-defined conversion from "win32::gui::wnd_iterator<win32::gui::window_base>" to "win32::gui::wnd_iterator<win32::gui::splitter>" exists
                    wnd_iterator<splitter> begin0 = find_wnd_range<splitter>(window(),search_children), end0;
                                                    ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\splitter.cpp(114): error: no instance of function template "std::copy" matches the argument list
                  argument types are: (win32::gui::wnd_iterator<win32::gui::window_base>, win32::gui::wnd_iterator<win32::gui::splitter>, std::back_insert_iterator<std::vector<win32::gui::wnd<win32::gui::splitter>, std::allocator<win32::gui::wnd<win32::gu
      i::splitter>>>>)
                    std::copy( find_wnd_range<splitter>(window(),search_children), wnd_iterator<splitter>(), std::back_inserter(splitters));
                    ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\splitter.cpp(131): error: class "win32::gui::window_base" has no member "m_splitted"
                        int best_count = (int)window()->child<splitter>(best_id)->m_splitted.size();
                                                                                  ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\splitter.cpp(133): error: class "win32::gui::window_base" has no member "m_splitted"
                            int current_count = (int)window()->child<splitter>(*b)->m_splitted.size();
                                                                                    ^
      tray_wnd.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\splitter.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui\src\tray_wnd.cpp(66): error: namespace "std" has no member "min"
            int len = std::min<int>( (int)tip.size(), 63);
                           ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\tray_wnd.cpp(66): error: type name is not allowed
            int len = std::min<int>( (int)tip.size(), 63);
                               ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\tray_wnd.cpp(79): error: namespace "std" has no member "min"
            int len = std::min<int>( (int)new_tip.size(), 63);
                           ^
      F:\win32gui-lib-v1.4.1b\win32gui\src\tray_wnd.cpp(79): error: type name is not allowed
            int len = std::min<int>( (int)new_tip.size(), 63);
                               ^
      view_frame.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\tray_wnd.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui\src\view_frame.cpp(135): error: no suitable user-defined conversion from "win32::gui::wnd_iterator<win32::gui::window_base>" to "win32::gui::wnd_iterator<win32::gui::toolbar>" exists
                    for ( wnd_iterator<toolbar> begin4 = find_wnd_range<toolbar>(), end4; begin4 != end4; ++begin4) {
                                                         ^
      F:\win32gui-lib-v1.4.1b\win32gui/shared_ptr/shared_ptr.hpp(193): error: cannot convert pointer to base class "win32::gui::window_base" to pointer to derived class "win32::gui::rebar" -- base class is virtual
            wnd_shared_ptr(wnd_shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
                                                            ^
                detected during:
                  instantiation of "win32::gui::wnd_shared_ptr<T>::wnd_shared_ptr(const win32::gui::wnd_shared_ptr<Y> &) [with T=win32::gui::rebar, Y=win32::gui::window_base]" at line 215 of "F:\win32gui-lib-v1.4.1b\win32gui/window.hpp"
                  instantiation of "win32::gui::wnd<impl>::wnd(const win32::gui::wnd<other_impl> &) [with impl=win32::gui::rebar, other_impl=win32::gui::window_base]"
      F:\win32gui-lib-v1.4.1b\win32gui/shared_ptr/shared_ptr.hpp(193): error: cannot convert pointer to base class "win32::gui::window_base" to pointer to derived class "win32::gui::status_bar" -- base class is virtual
            wnd_shared_ptr(wnd_shared_ptr<Y> const & r): px(r.px), pn(r.pn) // never throws
                                                            ^
                detected during:
                  instantiation of "win32::gui::wnd_shared_ptr<T>::wnd_shared_ptr(const win32::gui::wnd_shared_ptr<Y> &) [with T=win32::gui::status_bar, Y=win32::gui::window_base]" at line 215 of "F:\win32gui-lib-v1.4.1b\win32gui/window.hpp"
                  instantiation of "win32::gui::wnd<impl>::wnd(const win32::gui::wnd<other_impl> &) [with impl=win32::gui::status_bar, other_impl=win32::gui::window_base]"
      window.cpp
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\view_frame.cpp (code 2)
      F:\win32gui-lib-v1.4.1b\win32gui\src\window.cpp(173): error: identifier "find_hwnds" is undefined
            find_hwnds( detail::descendant_hwnds, children, raw_hwnd());
            ^
      compilation aborted for F:\win32gui-lib-v1.4.1b\win32gui\src\window.cpp (code 2)
      Error executing cl.exe.

      vc6_proj.lib - 16 error(s), 0 warning(s)

       
      • John Torjo

        John Torjo - 2004-09-21

        Some of the gcc system files (windows.h and commctrl.h) are pretty old. This is usually source of errors for gcc. For 3.2, I've fixed this.

        Now I've downloaded the latest dev-c++ (with gcc3.3.1) and there was a small error. I've fixed it and it now compiles and runs as expected. I still need to do further tests, and will post a newer version later this week.

        As a side note - it will never work on vc6. As for Intel compiler, have not tested yet.

        win32gui works for gcc3.2+, vc71 and como4.3.4+.

        I will try to port it to Intel compiler though - but when I have the time. That is most likely 1 month from now.

        Best,
        John

         
      • John Torjo

        John Torjo - 2004-09-21

        side-note related to .net framework

        If you use win32gui - there are no other dependencies (on .dlls and stuff)

        Best,
        John

         
    • Qiuwg

      Qiuwg - 2004-09-22

      You're a kind boy - maybe a kind man :)
      First of all, thank you very much.
      ---------------------------------------
      I visit here everyday, give you a suggest: could you write something about compiling in the doc files in next rar, like which must be modified in gcc head files, or others (for I never succeed in getting the lib files).

      Hmm, Intel C++ Compiler v7.1 is good in generating executable file size than MS's VC6 compiler, and Intel's Compiler can also inbuild in VC6's IDE----I mean in VC6 IDE's menu, you could select use which compiler to build current project.

      But from the build message above, you can see it doesn't support c++ template as good as we expect, so if you want to port it to that compiler, you may pay much work, however we all support you.

      -----------
      Oh, I know .net framework are based on common language runtime (CLR-?), so I'm afraid when I finished my project, the custom will give me much complaint for they need to install it. I know the project on c# should do so, but don't know whether c++ shoud do it also.

       
      • John Torjo

        John Torjo - 2004-09-22

        I will indeed write something in the ReleaseNotes.txt in the upcoming version.

        And it does seem that intel 7.1 has some trouble with templates. When I'll get the (Intel) compiler, I'll see what I can do.

        As for vc71. - when you create a "Visual C++" project (Win32 Project) - there is NO need for the .net framework. So, don't worry...

        Best,
        John

         

Log in to post a comment.