How can I use gtkmm with MinGW (g++) without MSYS?

Hello programmersheaven members,
How can I use gtkmm with MinGW (g++) without MSYS?
Here is the story of my problem:
I installed MinGW offline with all required packages (full install).
I installed Apache Server and I copied all .tar.gz files and I created a website called sourceforge.org [localhost] and I installed automatically MinGW on Windows XP.
After, I set the PATH variables.
After, I installed gtkmm for MinGW (g++).
I tried to compile a simple window with gtkmm + MinGW, but it does not work.
I use this command line:
g++ simple.cc -o simple `pkg-config gtkmm-2.4 --cflags --libs`
After, I installed MSYS and I can compile simple.cc with MSYS, using this command line:
g++ simple.cc -o simple `pkg-config gtkmm-2.4 --cflags --libs`
My problem:
I want to compile simple.cc without MSYS. I want compile my simple.cc with cmd.exe - It's possbile? If, yes. How?
Thank you for reading my message.
Any help is appreciated.

Comments

  • Hi!

    What was the error message without MSYS?

    It was long time ago, but as I can remember, I add the command line options to g++ manually.
    I mean, see the pkg-config output, and add it manually after g++. It worked for me.
    (I'll try it again tomorrow)

    Now I'm using Fedora, it includes the win32 mingw binaries, so you can generate win32 executables without windows :) I think it's the better solution:)

    Regards:
    Imre Horvath
    Regards: -blemidon-
  • Thank you for your message to me.
    I'm using Windows XP. I'm also using linux Ubuntu, but I want to compile my programs under Windows XP. g++ with gtkmm works ok under Ubuntu, but not under XP. I can to compile a command line application, but not with gtkmm.
    Here is my problem in depth:
    base.cc source code:
    [code]#include

    int main(int argc, char *argv[])
    {
    Gtk::Main kit(argc, argv);
    Gtk::Window window;
    Gtk::Main::run(window);
    return 0;
    }[/code]
    Command line:
    [code]pkg-config gtkmm-2.4 --cflags --libs[/code]
    Result:
    [code]-mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl[/code]
    Command line:
    [code]g++ base.cc -o base `pkg-config gtkmm-2.4 --cflags --libs`[/code]
    Result:
    [code]g++: `pkg-config: No such file or directory
    g++: gtkmm-2.4: No such file or directory
    cc1plus.exe: error: unrecognized command line option "-fcflags"
    cc1plus.exe: error: unrecognized command line option "-flibs`"[/code]
    Command line:
    [code]g++ base.cc -o base -D_REENTRANT -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl[/code]
    Result:
    Many errors looks like:
    [code]C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:269: error: ISO C++ forbids declar
    ation of `get_icon' with no type
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Gio' has not been dec
    lared
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Icon' was not declare
    d in this scope
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: ISO C++ forbids declar
    ation of `property_gicon' with no type
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Gio' has not been dec
    lared
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Icon' was not declare
    d in this scope
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: ISO C++ forbids declar
    ation of `property_gicon' with no type[/code]
    Command line:
    [code]g++ base.cc -o base -mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl[/code]
    Result:
    Many errors looks like:
    [code]C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:269: error: ISO C++ forbids declar
    ation of `get_icon' with no type
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Gio' has not been dec
    lared
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: `Icon' was not declare
    d in this scope
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:589: error: ISO C++ forbids declar
    ation of `property_gicon' with no type
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Gio' has not been dec
    lared
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: `Icon' was not declare
    d in this scope
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: template argument 1 is
    invalid
    C:/gtkmm/include/gtkmm-2.4/gtkmm/statusicon.h:599: error: ISO C++ forbids declar
    ation of `property_gicon' with no type[/code]
    By the way, I'm also using [color=Red]``[/color], looks like:
    [code]g++ base.cc -o base [color=Red]`[/color]-mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4-IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0-lgthread-2.0 -lglib-2.0 -lintl[color=Red]`[/color][/code]
    if I use MSYS I can compile base.cc, but I need to compile it without MSYS.
    Another information (perhaps necessary) about PATH (maybe here is the wrong):
    Path 1:
    =======
    Variable name: path
    Variable value: C:MinGWin
    Path 2:
    =======
    Variable name: PKG_CONFIG_PATH
    Variable value: C:gtkmmlibpkgconfig
    What can I do?
    Please help me to solve my problem.
    I apologize for my English level (in case you did not properly understand my message).
  • So, i've installed gtkmm-win32-devel-2.20.0-1.exe and MinGW-5.1.6.exe (with MinGW Base Tools, g++ and MinGW Make).
    Add c:mingwin to the path (gtkmm puts itself into path during install)

    Then I can compile your program:
    get pkg-config output:

    C:Documents and SettingswardenAsztalmingw>pkg-config gtkmm-2.4 --libs --cfl
    ags
    -mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC
    :/gtkmm/include/giomm-2.4 -IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pa
    ngomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtk
    mm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/inclu
    de -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/in
    clude/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC
    :/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cai
    romm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkm
    m/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/li
    b/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm
    -1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairom
    m-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin
    32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0
    -lgthread-2.0 -lglib-2.0 -lintl

    Append it after g++:

    g++ base.cc -o base -mms-bitfields -IC:/gtkmm/include/gtkmm-2.4 -IC:/gtkmm/lib/gtkmm-2.4/include -IC:/gtkmm/include/giomm-2.4 -IC:/gtkmm/lib/giomm-2.4/include -IC:/gtkmm/include/pangomm-1.4 -IC:/gtkmm/lib/pangomm-1.4/include -IC:/gtkmm/include/gtk-2.0 -IC:/gtkmm/include/atkmm-1.6 -IC:/gtkmm/include/gdkmm-2.4 -IC:/gtkmm/lib/gdkmm-2.4/include -IC:/gtkmm/include/glibmm-2.4 -IC:/gtkmm/lib/glibmm-2.4/include -IC:/gtkmm/include/glib-2.0 -IC:/gtkmm/lib/glib-2.0/include -IC:/gtkmm/include/sigc++-2.0 -IC:/gtkmm/lib/sigc++-2.0/include -IC:/gtkmm/include/cairomm-1.0 -IC:/gtkmm/lib/cairomm-1.0/include -IC:/gtkmm/include/pango-1.0 -IC:/gtkmm/include/cairo -IC:/gtkmm/include/freetype2 -IC:/gtkmm/include -IC:/gtkmm/include/libpng14 -IC:/gtkmm/lib/gtk-2.0/include -IC:/gtkmm/include/atk-1.0 -LC:/gtkmm/lib -lgtkmm-2.4 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-win32-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl

    It compiled without errors...

    You have to add these options manually, bacause windows doesn't understand ``. It's what MSYS for.

    I've tried your command line, it doesn't work. As I can remember, I faced a problem like this some years ago, then i've got 2 pkg-config. One in c:gtkmmin and one in mingw (maybe in MSYS). Make sure you use the one in c:gtkmmin

    Regards:
    Imre Horvath
  • Thank you very much, blemidon. Your solution works for me, now I can compile base.cc without MSYS. Thanks!
    If You know about this domain, I have another question about gtkmm and I don't want to launch another thread on forum.
    I attached a picture named base.jpg - Look at this picture!
    The base program is launched with MS-DOS console. MS-DOS console appears behind base's main frame window.
    How can I remove MS-DOS from base program?
  • I can solve this problem by the following 2 scripts:
    1st create a batch file to run your program:
    hidden.bat:

    base.exe

    and a vbsctipt file:
    hidden.vbs:

    Set WshShell = CreateObject("WScript.Shell")
    WshShell.Run chr(34) & "hidden.bat" & Chr(34), 0
    Set WshShell = Nothing

    This executes the batch file without command window, and the batch file executes your app.

    Not a nice solution, but works:)

    i've also found a software for this:
    hstart by NTWind (Google it)

    Regards:
    Imre Horvath
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion