GCC(in windows minGW 32) -mwindows return error

classic Classic list List threaded Threaded
7 messages Options
Tal
Reply | Threaded
Open this post in threaded view
|

GCC(in windows minGW 32) -mwindows return error

Tal
I have tried to build a simple GUI program in Vala(which use minGW GCC in windows).
Here is the code in Vala(doesn't matter at all):

using Gtk;

int main (string[] args) {
    Gtk.init (ref args);

    var window = new Window ();
    window.title = "First GTK+ Program";
    window.set_default_size (300, 50);
    window.position = WindowPosition.CENTER;
    window.destroy.connect (Gtk.main_quit);

    var button = new Button.with_label ("Click me!");
    button.clicked.connect (() => {
        button.label = "Thank you";
    });

    window.add (button);
    window.show_all ();

    Gtk.main ();
    return 0;
}

When I compile this code with this line:

valac --pkg gtk+-2.0 main.vala

everything is perfect, but there is the console(command prompt) which looks ugly and useless.
I googled up and found a solution that should work - build with the GCC option "-mwindows".
However, it returns an error in the "ld.exe" file(I think it is the linker).
Here is the console:

C:\noSpace\test>valac -X -mwindows --pkg gtk+-2.0 main.vala
C:\noSpace\Programs\vala-0.11.5\bin\ld.exe: cannot find -lcomdlg32
collect2: ld returned 1 exit status
error: cc exited with status 1
Compilation failed: 1 error(s), 0 warning(s)

C:\noSpace\Programs\vala-0.11.5\bin is my %path% and "-X" means to pass the option to the GCC.
I tried also to build it with the official version of the minGW(first compile Vala to C code and then compile it with official GCC of minGW), but the same error got back).
I search a lot for this "-mwindows", and haven't find a solution at all!
Anyone know how to fix it?
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

Earnie Boyd
tal - טל hadad - חדד wrote:
>
> I have tried to build a simple GUI program in Vala(which use minGW GCC in windows).
> Here is the code in Vala(doesn't matter at all):
>

I have no clue what Vala is.

> using Gtk;
>
> int main (string[] args) {
>     Gtk.init (ref args);
>
>     var window = new Window ();
>     window.title = "First GTK+ Program";
>     window.set_default_size (300, 50);
>     window.position = WindowPosition.CENTER;
>     window.destroy.connect (Gtk.main_quit);
>
>     var button = new Button.with_label ("Click me!");
>     button.clicked.connect (() => {
>         button.label = "Thank you";
>     });
>
>     window.add (button);
>     window.show_all ();
>
>     Gtk.main ();
>     return 0;
> }
>
> When I compile this code with this line:
>
> valac --pkg gtk+-2.0 main.vala
>
> everything is perfect, but there is the console(command prompt) which looks ugly and useless.
> I googled up and found a solution that should work - build with the GCC option "-mwindows".
> However, it returns an error in the "ld.exe" file(I think it is the linker).
> Here is the console:
>
> C:\noSpace\test>valac -X -mwindows --pkg gtk+-2.0 main.vala
> C:\noSpace\Programs\vala-0.11.5\bin\ld.exe: cannot find -lcomdlg32
> collect2: ld returned 1 exit status
> error: cc exited with status 1
> Compilation failed: 1 error(s), 0 warning(s)
>

So why are you missing the libcomdlg32.a file in the library directory?
 Perhaps you need to ask Vala support.

--
Earnie
-- http://www.for-my-kids.com

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Tal
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

Tal
> So why are you missing the libcomdlg32.a file in the library directory?

Thanks Earnie, you solve my problem that cost me 2 weeks....

I just have needed to copy this file from the official minGW to Vala directory.

> Perhaps you need to ask Vala support.

Seems to be their bug as you mentioned.

Thanks again, and Vala will be great for you if you are a developer which want OOP and auto memory management in C(not like .Net and Java, that need extra process and are very slow) via gobject lib.
See: http://live.gnome.org/Vala/Tutorial

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

Charles Wilson-2
In reply to this post by Earnie Boyd
On 4/5/2011 1:43 PM, Earnie wrote:
> tal - טל hadad - חדד wrote:
>>
>> I have tried to build a simple GUI program in Vala(which use minGW GCC in windows).
>> Here is the code in Vala(doesn't matter at all):
>>
>
> I have no clue what Vala is.

Vala is a new programming language (well, sorta) developed by the GNOME
people to "wrap" the facilities of glib's GObject.  The syntax is kinda
C#-ish, but doesn't require an interpreter or additional runtime; you
just link with the glib libraries.  The vala compiler/linker handles
that for you.

Their bundle for Windows piggy backs on (bundles) MinGW gcc, w32api.  It
might be a useful project if someone wanted to create a
mingw-get-compatible package of the frontend components of vala...That
way, the GNOME people could just say "go get mingw-get and do 'mingw-get
install vala' and all the deps would come in for free and be installed
correctly.

--
Chuck

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

lrn-2
On 05.04.2011 22:50, Charles Wilson wrote:

> On 4/5/2011 1:43 PM, Earnie wrote:
>> tal - טל hadad - חדד wrote:
>>> I have tried to build a simple GUI program in Vala(which use minGW GCC in windows).
>>> Here is the code in Vala(doesn't matter at all):
>>>
>> I have no clue what Vala is.
> Vala is a new programming language (well, sorta) developed by the GNOME
> people to "wrap" the facilities of glib's GObject.  The syntax is kinda
> C#-ish, but doesn't require an interpreter or additional runtime; you
> just link with the glib libraries.  The vala compiler/linker handles
> that for you.
AFAIK, vala compiler just compiles vala code to C code that implements
OOP via GObject. After that mingw-gcc comes into play. That is, vala is
a kind of syntactic sugar.

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

Charles Wilson-2
In reply to this post by Charles Wilson-2
On 4/5/2011 2:50 PM, Charles Wilson wrote:
>  "go get mingw-get and do 'mingw-get
> install vala' and all the deps would come in for free"

Well, maybe not. Their bundle also includes glib libraries and headers,
and THEIR dependencies, and what not.  Let me rephrase...

It might be a useful project if *GNOME* wanted to set up a mingw-get
compatible repository, with (sub)packages named appropriately, so that
'mingw-get install vala' with an appropriate profile.xml would DTRT.

But that's up to them, I suppose. Granted, they won't do such a thing
without encouragement from our end -- or from a volunteer with feet in
both camps, as it were.

--
Chuck

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe
Reply | Threaded
Open this post in threaded view
|

Re: GCC(in windows minGW 32) -mwindows return error

Charles Wilson-2
In reply to this post by lrn-2
On 4/5/2011 3:01 PM, LRN wrote:

> On 05.04.2011 22:50, Charles Wilson wrote:
>> On 4/5/2011 1:43 PM, Earnie wrote:
>>> I have no clue what Vala is.
>> Vala is a new programming language (well, sorta) developed by the GNOME
>> people to "wrap" the facilities of glib's GObject.  The syntax is kinda
>> C#-ish, but doesn't require an interpreter or additional runtime; you
>> just link with the glib libraries.  The vala compiler/linker handles
>> that for you.
> AFAIK, vala compiler just compiles vala code to C code that implements
> OOP via GObject. After that mingw-gcc comes into play. That is, vala is
> a kind of syntactic sugar.

Right, that's what I meant by "(well, sorta)". :-)

--
Chuck

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe