I want to know if GTK+ can be used with OpenWatcom compiler.
thanks !
I have installed GTK+, no problems to compile programs with
OpenWatcom.
Linking is not working, it seems the wlink can't use GTK+ libraries.
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
You have right, sorry for that.
I'm using openwatcom 1.9 on windows.
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
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
\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
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
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
"moromete" <romeo....@gmail.com> wrote in message
news:11a7a70c-f8ec-4edc...@c20g2000yqj.googlegroups.com...
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
> 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
> 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
Congrats !
Lynn
> 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