OpenCOBOL Forum Index OpenCOBOL
using gui interface (SOLVED!) | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| federico | Posted on: 2010/2/14 12:25 |
Just can't stay away ![]() ![]() Joined: 2010/2/7 From: Posts: 114 |
using gui interface (SOLVED!) Hi, is there someone that tried to use opencobol with a gui interface ? I have read about GTK but before to going ahead I would like to have a feedback from who already is doing this.
Thanks in adance. Federico |
| btiffin | Posted on: 2010/2/14 20:43 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 755 |
Re: using gui interface It's been a year, but maybe Paul could get you some practical feedback.
http://groups.google.com/group/comp.lang.cobol/browse_thread/thread/8504516938a0f0d2/b36a43145f67be31?lnk=gst&q=gtk#b36a43145f67be31 That is a year old link, and I doubt the clc readers would appreciate any necro posting, but I think a little detective work can get you in touch with Paul. From how the thread ended, I'm pretty sure he was off to the races. IF you will ever need a GUI in more than a one-off application, I'd still take a serious look at the Vala angle. http://www.opencobol.org/modules/newbb/viewtopic.php?topic_id=526&forum=1&post_id=2700#forumpost2700 It'll make creating a graphical binding for OC a LOT easier, imho. Cheers, Brian |
| federico | Posted on: 2010/2/18 6:33 |
Just can't stay away ![]() ![]() Joined: 2010/2/7 From: Posts: 114 |
Re: using gui interface Hi all,...and please forgive me I am really new with OC.
I would like to avoid to fill the forum with banal questions and then please excuse me . I'm sure you know what I am asking for. I am trying to compile the sample gtk demo there 2 file: the c wrapper and the cobol, using the command line: cobc -c `pkg-config --cflags gtk+-2.0` ocgtk.c cobc -x `pkg-config --libs gtk+-2.0` gtkhello.cob ocgtk.o I also installed the gtk package.. the compiler issues this error: cobc: unrecognized option `--cflags' cobc: unrecognized option `--libs' I am using the OC 1.1. maybe do I forgot to set some environment variable ? . Federico |
| btiffin | Posted on: 2010/2/18 12:44 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 755 |
Re: using gui interface Hmm, something is not right.
Try without the backtick escaping. You should get something like cobc should not be seeing the --cflags. That should be eaten as a parameter to the backticked pkg-config. So, something is not quite right. Cheers, Brian |
| federico | Posted on: 2010/2/18 13:16 |
Just can't stay away ![]() ![]() Joined: 2010/2/7 From: Posts: 114 |
Re: using gui interface I forgot to tell that I am using it with windows xp
sending the command from the prompt with this c:\opencobol\pkg-config --cflags gtk+-2.0 I get this. -mms-bitfields -IC:/GTK/include/gtk-2.0 -IC:/GTK/lib/gtk-2.0/include -IC:/GTK/include/atk-1.0 -IC:/GTK/include/cairo -IC:/GTK/include/pango-1.0 -IC:/GTK/include/glib-2.0 -IC:/GTK/lib/glib-2.0/include -IC:/GTK/include/freetype2 -IC:/GTK/include -IC:/GTK/include/libpng12 |
| btiffin | Posted on: 2010/2/18 23:27 |
Home away from home ![]() ![]() Joined: 2008/6/7 From: CANADA Posts: 755 |
Re: using gui interface Arrr, sad for you. ;) No, it's just that Windows shells don't handle backtick tricks.
You'll need to capture the output of --cflags and --libs and use that as part of the cobc command line directly. So Things like mms-bitfields, we might have to drag in a Windows building expert. human? Sergey? As a matter of fact, I think human has the technology for the Express edition of Visual Studio ?? which might make your life easier once you get a good GTK Visual Studio project template defined. feel free to ignore the ranting OR do yourself a favour and get a developer friendly GNU/Linux operating system. Much more fun to be free then, well, not free and working in a 'we presume you will steal from us, so we treat everyone like crooks' environment. Cheers, Brian |
| human | Posted on: 2010/2/19 15:23 |
Home away from home ![]() ![]() Joined: 2007/5/15 From: Posts: 967 |
Re: using gui interface Just because I was indirectly asked... For Win systems I would try to put the following in a batch file and run the stuff:
human |
| federico | Posted on: 2010/2/19 22:00 |
Just can't stay away ![]() ![]() Joined: 2010/2/7 From: Posts: 114 |
Re: using gui interface Well...I am just realizing that windows doesn't know lot of flags opencoboL required. You all were really precious helping me going ahead. However right now (after some short changes ) the c compiler issues this messages (written below). I suppose that also the microsoft c complier is not the best than I would like to install the mingw c complier. before I compiled fine some old microfocus and rmcobol sources by using oc with microsoft free compiler. But after this test I am becoming to suppose i need to switch to another c compiler. Actually I am working with powercobol that has a great gui interface and I would like to use one like gtk with OC. Am I wrong ? Thanks for your great and really appreciated help. (the error message that I put is in italian language but i'm sure you can understand ...the c compiler can't recognize the library statements) Ciao Federico cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgtk-win32-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgdk-win32-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-latk-1.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgio-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgdk_pixbuf-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lpangowin32-1.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgdi32' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lpangocairo-1.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lpango-1.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lcairo' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgobject-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lgmodule-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lglib-2.0' verr… ignorata cl : warning della riga di comando D9002 : l'opzione sconosciuta '-lintl.lib' verr… ignorata |
| human | Posted on: 2010/2/20 20:36 |
Home away from home ![]() ![]() Joined: 2007/5/15 From: Posts: 967 |
Re: using gui interface It's just the problem of the old cobc, these flags were not given to MSC in the right way.
You could either download the fixed one along with the MSVC project files from http://kiska.net/opencobol/human and compile OC yourself or just wait for the next pre-release. human |
| federico | Posted on: 2010/2/21 8:26 |
Just can't stay away ![]() ![]() Joined: 2010/2/7 From: Posts: 114 |
Re: using gui interface Ok. I after the test I used the -v arguments to see what the cobc was executing..after I realized also that I was passing i wrong parameters. After that I have almost solved. I meant thanks your help I can almost understand what I mistaked.
Now this is the situation. I can obtain the first object required to prepare the wrapper then the compiler save correctly ocgtk.obj. Now this is the compiler batch version you kindly wrote in your previous reply: @echo off setlocal :: Getting all necessary flags For /F "Tokens=*" %%I in ('pkg-config --cflags gtk+-2.0') Do Set myGTKcflags=%%I For /F "Tokens=*" %%I in ('pkg-config --libs gtk+-2.0') Do Set myGTKlibs=%%I :: Compile stuff cobc -c %myGTKcflags% ocgtk.c cobc -x %myGTKlibs% gtkhello.cob ocgtk.o endlocal I put the output of the first variable in a file to compile and obtain the object file (ocgtk.obj) and I changed the comand line of the last into: ------------------------------ last batch version---- @echo on For /F "Tokens=*" %%I in ('pkg-config --cflags gtk+-2.0') Do Set myGTKcflags=%%I For /F "Tokens=*" %%I in ('pkg-config --libs gtk+-2.0') Do Set myGTKlibs=%%I cls cobc -v -c -IC:/gtk/include/gtk-2.0 -IC:/gtk/lib/gtk-2.0/include -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng12 ocgtk.c 2> errori cobc -x -v %myGTKlibs% gtkhello.cob c:\opencobol\ocgtk.obj > errori1 e errori1 -------------------------------------------------- then I ran the batch and this is last errori1: --------------------------errori1 file------------- cobA5.c Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:gtkhello.exe gtkhello.obj c:\opencobol\ocgtk.obj c:/OpenCobol/libcob.lib c:/OpenCobol/gmp.lib Creazione della libreria gtkhello.lib e dell'oggetto gtkhello.exp in corso... ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_init_check_abi_check non risolto nella funzione _CBL_OC_GTK_INIT_CHECK ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_window_new non risolto nella funzione _CBL_OC_GTK_WINDOW_NEW ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_window_set_title non risolto nella funzione _CBL_OC_GTK_WINDOW_SET_TITLE ocgtk.obj : error LNK2019: riferimento al simbolo esterno _g_type_check_instance_cast non risolto nella funzione _CBL_OC_GTK_WINDOW_SET_TITLE ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_window_get_type non risolto nella funzione _CBL_OC_GTK_WINDOW_SET_TITLE ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_container_set_border_width non risolto nella funzione _CBL_OC_GTK_CONTAINER_SET_BORDER_WIDTH ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_container_get_type non risolto nella funzione _CBL_OC_GTK_CONTAINER_SET_BORDER_WIDTH ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_vbox_new non risolto nella funzione _CBL_OC_GTK_VBOX_NEW ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_hbox_new non risolto nella funzione _CBL_OC_GTK_HBOX_NEW ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_box_pack_start non risolto nella funzione _CBL_OC_GTK_BOX_PACK_START ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_box_get_type non risolto nella funzione _CBL_OC_GTK_BOX_PACK_START ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_button_new_with_label non risolto nella funzione _CBL_OC_GTK_BUTTON_NEW_WITH_LABEL ocgtk.obj : error LNK2019: riferimento al simbolo esterno _g_signal_connect_data non risolto nella funzione _CBL_OC_G_SIGNAL_CONNECT ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_container_add non risolto nella funzione _CBL_OC_GTK_CONTAINER_ADD ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_widget_show non risolto nella funzione _CBL_OC_GTK_WIDGET_SHOW ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_main non risolto nella funzione _CBL_OC_GTK_MAIN ocgtk.obj : error LNK2019: riferimento al simbolo esterno _gtk_main_quit non risolto nella funzione _CBL_OC_GTK_MAIN_QUIT gtkhello.exe : fatal error LNK1120: 17 esterni non risolti There is a missing library.. I don't know... May I write a link batch manually ? I tried to compile last with the -c option and I could try to write a batch to link.. ..but maybe there is a more simple way to perform this Thanks again for your help. Federico |
| (1) 2 3 » | |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |







