Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GTK+ and OpenWatcom

50 views
Skip to first unread message

moromete

unread,
Oct 21, 2010, 8:11:18 AM10/21/10
to
Hi !

I want to know if GTK+ can be used with OpenWatcom compiler.

thanks !

moromete

unread,
Oct 22, 2010, 12:08:00 AM10/22/10
to
Hi !

I have installed GTK+, no problems to compile programs with
OpenWatcom.
Linking is not working, it seems the wlink can't use GTK+ libraries.

Roald Ribe

unread,
Oct 22, 2010, 3:01:29 AM10/22/10
to
On Fri, 22 Oct 2010 01:08:00 -0300, moromete <romeo....@gmail.com>
wrote:

> I have installed GTK+, no problems to compile programs with
> OpenWatcom.

It would be good if your question included the platform you are working on
and OW version.

> Linking is not working, it seems the wlink can't use GTK+ libraries.

If it is on Linux, it is understandable, since OW does not support shared
libraries yet.
(see http://www.openwatcom.org/index.php/Linux_Port)
If you are on a different platform, more details on what goes wrong would
be useful.

Roald

moromete

unread,
Oct 22, 2010, 3:37:29 AM10/22/10
to
On 22 oct., 10:01, "Roald Ribe" <r...@pogostick.net> wrote:
> On Fri, 22 Oct 2010 01:08:00 -0300, moromete <romeo.petr...@gmail.com>  

> wrote:
>
> > I have installed GTK+, no problems to compile programs with
> > OpenWatcom.
>
> It would be good if your question included the platform you are working on  
> and OW version.
>
> > Linking is not working, it seems the wlink can't use GTK+ libraries.
>
> If it is on Linux, it is understandable, since OW does not support shared  
> libraries yet.
> (seehttp://www.openwatcom.org/index.php/Linux_Port)

> If you are on a different platform, more details on what goes wrong would  
> be useful.
>
> Roald

You have right, sorry for that.
I'm using openwatcom 1.9 on windows.

moromete

unread,
Oct 22, 2010, 4:09:07 AM10/22/10
to
I don't have more details now, i'm at office, but i will post
details soon.

moromete

unread,
Oct 22, 2010, 12:24:25 PM10/22/10
to
On Oct 22, 10:01 am, "Roald Ribe" <r...@pogostick.net> wrote:
> On Fri, 22 Oct 2010 01:08:00 -0300, moromete <romeo.petr...@gmail.com>  

> wrote:
>
> > I have installed GTK+, no problems to compile programs with
> > OpenWatcom.
>
> It would be good if your question included the platform you are working on  
> and OW version.
>
> > Linking is not working, it seems the wlink can't use GTK+ libraries.
>
> If it is on Linux, it is understandable, since OW does not support shared  
> libraries yet.
> (seehttp://www.openwatcom.org/index.php/Linux_Port)

> If you are on a different platform, more details on what goes wrong would  
> be useful.
>
> Roald

I'm using openwatcon in windows.
this is log file from compiling in IDE.
--------------------------------------
cd d:\working.win\GTK
wmake -f D:\working.win\GTK\test.mk -h -e d:\working.win\GTK\test.exe
wpp386 main.cpp -i="d:\WATCOM/h;d:\WATCOM/h/nt" -i=\gtk2\include -i=
\gtk2\include\gtk-2.0 -i=\gtk2\lib\glib-2.0\include -i=\gtk2\include
\glib-2.0\include -i=\gtk2\include\glib-2.0 -i=\gtk2\include\cairo -i=
\gtk2\include\pango-1.0 -i=\gtk2\lib\glib-2.0\include -i=\gtk2\include
\glib-2.0\include -i=\gtk2\lib\gtk-2.0\include -i=\gtk2\include
\atk-1.0 -w4 -e25 -zq -od -d2 -6r -bt=nt -fo=.obj -mf -xs -xr
wlink name test d all sys nt_win op m op maxe=25 op q op symf
@test.lk1
Error! E2028: gtk_init_abi_check_ is an undefined reference
Error! E2028: gtk_window_new_ is an undefined reference
Error! E2028: gtk_widget_show_ is an undefined reference
Error! E2028: gtk_main_ is an undefined reference
file main.obj(D:\working.win\GTK\main.cpp): undefined symbol
gtk_init_abi_check_
file main.obj(D:\working.win\GTK\main.cpp): undefined symbol
gtk_window_new_
file main.obj(D:\working.win\GTK\main.cpp): undefined symbol
gtk_widget_show_
file main.obj(D:\working.win\GTK\main.cpp): undefined symbol gtk_main_
Error(E42): Last command making (d:\working.win\GTK\test.exe) returned
a bad status
Error(E02): Make execution terminated
Execution complete

library gtk-win32-2.0.lib is added to project files.

Wilton Helm

unread,
Oct 22, 2010, 1:13:20 PM10/22/10
to
If the GTK+ libraries are C++ that is probably not resolvable, as each tool
chain has their own expectations for what the RTL does to support certain
features. The libraries would have to be compiled by OW also. OTOH, if it
is C and assembly, it probably only needs calling conventions specified.
The OW documentation discusses this.

Wilton


Lynn McGuire

unread,
Oct 22, 2010, 1:45:24 PM10/22/10
to
>>> I have installed GTK+, no problems to compile programs with
>>> OpenWatcom.
>>
>> It would be good if your question included the platform you are working on
>> and OW version.
>>
>>> Linking is not working, it seems the wlink can't use GTK+ libraries.
>>
>> If it is on Linux, it is understandable, since OW does not support shared
>> libraries yet.
>> (seehttp://www.openwatcom.org/index.php/Linux_Port)
>> If you are on a different platform, more details on what goes wrong would
>> be useful.
>>
>> Roald
>
> You have right, sorry for that.
> I'm using openwatcom 1.9 on windows.

Are you using GTK as Win32 DLLs or as linkable libraries ?

If Win32 DLLs, are you creating new link libraries using the
wlib tool ?

If linkable libraries, what was used to create these ? Are
you sure that the linkable libraries are compatible with OW ?
Each linker manufacturer tends to have their own binary library
file structure that is not usable by other linker manufacturers.

Lynn

Roger Markham

unread,
Oct 22, 2010, 8:38:48 PM10/22/10
to
This is just a guess, but you may have to specify stack calling
convention. I see from the line

\atk-1.0 -w4 -e25 -zq -od -d2 -6r -bt=nt -fo=.obj -mf -xs -xr

that you are using register calling to compile (that is the -6r that is
the default). The Microsoft calling convention is stack based and I
believe that OW decorates the reference names (leading, trailing, double
underscore) to keep these things sorted. With register calling, the
reference is not getting the correct decoration to be found in the
library. Finding the place to change convention is a bit of a
search--try compiler options.
Roger

moromete

unread,
Oct 22, 2010, 11:45:17 PM10/22/10
to

i'm using DLL's
i try to create the import library for libgtk-win32-2.0-0.dll with the
command:

wlib mylib.lib -+libgtk-win32-2.0-0.dll

and i try to use the new import library mylib.lib, but same result

Roald Ribe

unread,
Oct 23, 2010, 2:36:50 PM10/23/10
to

I agree, this most likely to be the solution. Open Watcom manuals,
the wiki and the Internet at large has a lot of information about DLL
calling conventions.

We would all be better off the .h files for DLL based libraries
decorated function prototypes with the correct calling convention.

Roald

David

unread,
Oct 24, 2010, 2:00:35 AM10/24/10
to
Does this mean we can create the GTK+ library on Windows and use OW in
windows for Linux targets and create GTK+ compatible Linux applications?

"moromete" <romeo....@gmail.com> wrote in message
news:11a7a70c-f8ec-4edc...@c20g2000yqj.googlegroups.com...

moromete

unread,
Oct 24, 2010, 4:50:23 AM10/24/10
to
On Oct 24, 9:00 am, "David" <n...@dont.invalid> wrote:
> Does this mean we can create the GTK+ library on Windows and use OW in
> windows for Linux targets and create GTK+ compatible Linux applications?
>
> "moromete" <romeo.petr...@gmail.com> wrote in message

>
> news:11a7a70c-f8ec-4edc...@c20g2000yqj.googlegroups.com...
>
> > Hi !
>
> > I want to know if GTK+ can be used with OpenWatcom compiler.
>
> > thanks !

Problem SOLVED !

i have downloaded the runtime and theme package package from here:
http://gtk-win.sourceforge.net/home/index.php/en/Downloads
runing wlib on needed dll's like this:
wlib -n -inn mygtk-win32-2.0-0.lib +libgtk-win32-2.0-0.dll
downloading dev packages from here:
http://www.gtk.org/download-windows.html
installing dev packages in c:\gtk2
must copy all my*.lib in c:\gtk2\lib
in openwatcom IDE Options->C++ Compiler Switches on "Include
directories [-i] add:

\gtk2\include \gtk2\include\gtk-2.0 \gtk2\lib\glib-2.0\include
\gtk2\include\glib-2.0\include \gtk2\include\glib-2.0 \gtk2\include
\cairo \gtk2\include\pango-1.0 \gtk2\lib\glib-2.0\include \gtk2\include
\glib-2.0\include \gtk2\lib\gtk-2.0\include \gtk2\include\atk-1.0

and on "Switches for making '*.cpp' in target" set -6s

and i's WORKING

hope to be usefull

Roald Ribe

unread,
Oct 24, 2010, 4:59:30 AM10/24/10
to
On Sun, 24 Oct 2010 03:00:35 -0300, David <no...@dont.invalid> wrote:

> Does this mean we can create the GTK+ library on Windows and use OW in
> windows for Linux targets and create GTK+ compatible Linux applications?

No. GTK+ on Linux is based on shared libraries. Which OW does not support.
Currently OW can only be used on Linux if you can compile all the
functionality you need into the same executable, and if none of that
functionality depends on other shared libraries.
In practice this means command line utilities or curses based / curses
like text mode applications is possible, and little else.

There is a design for the necessary functionality extensions in the C
compiler and the linker on the wiki, but so far nobody with the right
knowledge or the right itch has turned up to implement it. I guess it is
just easier to switch to a different compiler than to add the
functionality to OW.

On Windows OW has full support for shared libraries (DLL's) so there
should be no big problems using GTK+ on that platform, even if the DLL's
has been made with a different compiler.

Roald

Peter C. Chapin

unread,
Oct 24, 2010, 10:23:08 AM10/24/10
to
On 2010-10-24 04:50, moromete wrote:

> Problem SOLVED !

That's good to hear. If you feel inclined the details of how to do this
this might be worth adding to the Wiki for others to enjoy.

I understand that you might have other things to do. :)

Peter

Lynn McGuire

unread,
Oct 25, 2010, 11:28:01 AM10/25/10
to
>>> I want to know if GTK+ can be used with OpenWatcom compiler.
>>
>>> thanks !
>
> Problem SOLVED !

Congrats !

Lynn

Message has been deleted

Peter C. Chapin

unread,
Nov 9, 2010, 7:54:23 AM11/9/10
to
On 2010-11-09 00:33, moromete wrote:

> I don't understand what i mut to do on Wiki.
> My english is very poor.

You would have to create an account for yourself on the Wiki, then find
some suitable place for the information, and finally edit that page to
add what you know. However, I'm not sure where would be the best place
to add the information.

Peter


0 new messages