Home » Developer & Programmer » Precompilers, OCI & OCCI » does proc precompile gtk libraries? (Instant client PROC, Linux)
does proc precompile gtk libraries? [message #563918] Fri, 17 August 2012 18:13 Go to next message
thein
Messages: 9
Registered: February 2012
Junior Member
I'm having a problem prcompiling gtk functions in c files. Do you have any hints
Re: does proc precompile gtk libraries? [message #563924 is a reply to message #563918] Sat, 18 August 2012 02:32 Go to previous messageGo to next message
Littlefoot
Messages: 19615
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Not me, but someone might (only if you said what "problems" you have).
Re: does proc precompile gtk libraries? [message #563932 is a reply to message #563924] Sat, 18 August 2012 08:38 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
System default option values taken from: /usr/lib/oracle/11.2/client64/precomp/admin/pcscfg.cfg

PCC-F-02066, CMD-LINE: Could not find or could not open system config file
Syntax error at line 159, column 23, file /usr/include/glib-2.0/glib/gmessages.h:
Error at line 159, column 23 in file /usr/include/glib-2.0/glib/gmessages.h
#define g_error(format...) G_STMT_START { \
......................1
PCC-S-02014, Encountered the symbol "..." when expecting one of the following:

, )
The symbol ")" was substituted for "..." to continue.

Syntax error at line 292, column 50, file /usr/include/glib-2.0/glib/gtestutils.h:
Error at line 292, column 50 in file /usr/include/glib-2.0/glib/gtestutils.h
GLogLevelFlags log_level,
.................................................1
PCC-S-02201, Encountered the symbol "GLogLevelFlags" when expecting one of the f
ollowing:
Re: does proc precompile gtk libraries? [message #563937 is a reply to message #563932] Sat, 18 August 2012 09:05 Go to previous messageGo to next message
Michel Cadot
Messages: 59142
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is your proc/pcc command line?
What are the options in the mentioned configuration file?
Note that the message "Could not find or could not open system config file" seems to indicate a problem in your environment.

Regards
Michel
Re: does proc precompile gtk libraries? [message #563939 is a reply to message #563937] Sat, 18 August 2012 10:31 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
#/bin/make
###############################################################################
# Make file for PROC demos
###############################################################################
# Usage :
# For compiling proc demos
# make -f demo_proc_ic.mk
#
# For precompiling, compiling & linking the procdemo.pc file
# make -f demo_proc_ic.mk build EXE=procdemo OBJS=procdemo.o
#
# In general, for any proc program
# make -f demo_proc_ic.mk build EXE=<exename> OBJS="<list of dependent objs>"
#
# To make use of any PROC options during precompilation,
# make -f demo_proc_ic.mk build PROCFLAGS="<list of proc options>"
# EXE=<exename> OBJS="<list of dependent objs>"
#
# NOTES:
# 1. Please change "cc/CC" and the "InstantClient directories" to point to
# appropiate locations on your machine before using this makefile.
#
###############################################################################


CC=/usr/bin/gcc
cc=/usr/bin/gcc

# InstantClient Directories.
ICLIBHOME=$(RPM_BUILD_ROOT)/usr/lib/oracle/11.2/client64/lib/

MKLINK=ln -s
REMOVE=rm -rf
CLNCACHE=cleancache
CACHEDIR=SunWS_cachea
MAKE=make
MAKEFILE=demo_proc_ic.mk
PROCDEMO=procdemo

PROC=$(RPM_BUILD_ROOT)/usr/lib/oracle/11.2/client64/bin/proc
SO_EXT=.so
I_SYM=-I

CCINCLUDES= $(I_SYM)$(RPM_BUILD_ROOT)/usr/include/oracle/11.2/client64
GTKFLAGS=-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gdk-pixbuf-2.0
GTKLIBS=-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lfontconfig -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXfixes -lpango-1.0 -lcairo -lX11 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0

# Pre-compiler Flags.
PRECOMP_INCLUDE=$(I_SYM). $(SYS_INCLUDE)
PRECOMPPUBH=$(RPM_BUILD_ROOT)/usr/include/oracle/11.2/client64
GTKINC=/usr/include/gtk-2.0,/usr/lib/gtk-2.0/include,/usr/include/atk-1.0,/usr/include/cairo,/usr/include/pango-1.0,/usr/include/glib -2.0,/usr/lib/x86_64-linux-gnu/glib-2.0/include,/usr/include/freetype2,/usr/include/libpng12,/usr/lib/x86_64-linux-gnu/gtk-2.0/includ e,/usr/include/gdk-pixbuf-2.0
SYS_INCLUDE=sys_include=\($(PRECOMPPUBH),/usr/include,/usr/include/glib-2.0/glib,/usr/lib/gcc/x86_64-linux-gnu/4.6/include,/usr/lib/g cc/x86_64-linux-gnu/4.6.1/include,$(GTKINC)\)

# Compiler Flags.
OPTIMIZE=-O2
LDPATHFLAG=-L
SPFLAGS=-DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS
CCFLAGS= -fPIC -DPRECOMP
LDFLAGS=-g
LPFLAGS=
GFLAG=
CDEBUG=
USRFLAGS=
ICLIBPATH=$(LDPATHFLAG)$(ICLIBHOME)
PFLAGS=$(CCINCLUDES) $(SPFLAGS) $(LPFLAGS) $(GTKFLAGS)
CFLAGS=$(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS) $(USRFLAGS)

# Libraries.
PROLDLIBS=$(LDCLIENTLIBS) $(THREADLIBS)
LDCLIENTLIBS=$(ICLIBPATH) $(LLIBCLNTSH) $(LDLIBS)
LLIBCLNTSH=$(LDLIBFLAG)$(LIBCLNTSHNAME)
LDLIBFLAG=-l
LIBCLNTSHNAME=clntsh
LDLIBS=$(EXSYSLIBS) $(MATHLIB) $(USRLIBS) $(GTKLIBS)
EXSYSLIBS=-ldl
MATHLIB=-lm
THREADLIBS=-lpthread

C2O=$(CC) $(CFLAGS) -c $*.c
PCC2C=$(PROC) $(PROCFLAGS) iname=$(PCCSRC) $(PRECOMP_INCLUDE)
DEMO_PROC_BUILD=$(CC) -o $(EXE) $(OBJS) $(LDFLAGS) $(PROLDLIBS)

#-----------------------------------------------------------------------------
# Targets for building the proc sample programs.
all: clean $(PROCDEMO)

$(PROCDEMO):
$(MAKE) -f $(MAKEFILE) build OBJS=$@.o EXE=$@

build: $(CLNCACHE) $(OBJS)
$(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
$(DEMO_PROC_BUILD)
$(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)

#-----------------------------------------------------------------------------
# Here are some rules for converting .pc -> .c -> .o
.SUFFIXES: .pc .c .o

pc1:
$(PCC2C)

.pc.c:
$(MAKE) -f $(MAKEFILE) PROCFLAGS="$(PROCFLAGS)" PCCSRC=$* I_SYM=include= pc1

.pc.o:
$(MAKE) -f $(MAKEFILE) PROCFLAGS="$(PROCFLAGS)" PCCSRC=$* I_SYM=include= pc1
$(C2O)

.c.o:
$(C2O)

#-----------------------------------------------------------------------------
# Clean up all executables, *.o and generated *.c files
clean: $(CLNCACHE)
$(REMOVE) $(PROCDEMO) $(PROCDEMO).o $(PROCDEMO).c $(PROCDEMO).lis

cleancache:
$(REMOVE) $(CACHEDIR)
$(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)


This works with none GTK apps, But when i use gtk functions the precompiler complains.
This is a demo makefile that comes with the precompiler, Have added includes and libs for gtk.

Thanks,
Thein
Re: does proc precompile gtk libraries? [message #563940 is a reply to message #563939] Sat, 18 August 2012 10:53 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
Hi,

It knows how to build a Gtk app
with make -f demo_proc_ic.mk build EXE=table1 OBJS=table1.o
from table1.c
And it knows how to build
make -f demo_proc_ic.mk build EXE=demo OBJS=demo.o
from demo.pc
But it can't make
ake -f demo_proc_ic.mk build EXE=gtkdemo OBJS=gtkdemo.o
from gtkdemo.pc with gtk functions

Thanks,
Thein
Re: does proc precompile gtk libraries? [message #563941 is a reply to message #563940] Sat, 18 August 2012 11:02 Go to previous messageGo to next message
Michel Cadot
Messages: 59142
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Sorry but a make file is to hard to read to know what is the final command.
Please "echo" the pcc command before its execution in the make file.

In addition, this does not explain your error message that seems to indicate that something is not correctly set in your environment.

Regards
Michel
Re: does proc precompile gtk libraries? [message #563942 is a reply to message #563941] Sat, 18 August 2012 11:21 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
/usr/lib/oracle/11.2/client64/bin/proc iname=prufa include=. sys_include=\(/usr/include/oracle/11.2/client64,/usr/include,/usr/include/glib-2.0/glib,/usr/lib/gcc/x86_64-linux-gnu/4.6/include,/us r/lib/gcc/x86_64-linux-gnu/4.6.1/include,/usr/include/gtk-2.0,/usr/lib/gtk-2.0/include,/usr/include/atk-1.0,/usr/include/cairo,/usr/i nclude/pango-1.0,/usr/include/glib-2.0,/usr/lib/x86_64-linux-gnu/glib-2.0/include,/usr/include/freetype2,/usr/include/libpng12,/usr/l ib/x86_64-linux-gnu/gtk-2.0/include,/usr/include/gdk-pixbuf-2.0\)

Pro*C/C++: Release 11.2.0.3.0 - Production on Sat Aug 18 16:01:30 2012

This is the pcc that is run

Thanks,
Thein
Re: does proc precompile gtk libraries? [message #563944 is a reply to message #563942] Sat, 18 August 2012 12:34 Go to previous messageGo to next message
Michel Cadot
Messages: 59142
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Check if file "/usr/lib/oracle/11.2/client64/precomp/admin/pcscfg.cfg" exists.

Regards
Michel
Re: does proc precompile gtk libraries? [message #563947 is a reply to message #563944] Sat, 18 August 2012 13:20 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
Hi,

It is at another location "/usr/lib/oracle/11.2/client64/lib/precomp/admin/pcscfg.cfg"

I can put a logical name so it refernces it correctly but then there comes a error when it finds it

The file looks like this

sys_include=($ORACLE_HOME/include,/usr/include/linux,/usr/include,/usr/lib/gcc/x86_64-linux-gnu/4.6/include,/usr/lib/gcc/x86_64-linux -gnu/4.6.1/include,
/usr/include/gtk-2.0,/usr/lib/gtk-2.0/include,/usr/include/atk-1.0,/usr/include/cairo,/usr/include/pango-1.0,
/usr/include/glib-2.0,/usr/lib/x86_64-linux-gnu/glib-2.0/include,/usr/include/freetype2,/usr/include/libpng12,
/usr/lib/x86_64-linux-gnu/gtk-2.0/include,/usr/include/gdk-pixbuf-2.0)
ltype=short
define=__x86_64__

Thanks,
Thein
Re: does proc precompile gtk libraries? [message #563951 is a reply to message #563947] Sat, 18 August 2012 14:01 Go to previous messageGo to next message
Michel Cadot
Messages: 59142
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
but then there comes a error when it finds it


And the error is?

Regards
Michel
Re: does proc precompile gtk libraries? [message #563952 is a reply to message #563951] Sat, 18 August 2012 14:10 Go to previous messageGo to next message
thein
Messages: 9
Registered: February 2012
Junior Member
System default option values taken from: /usr/lib/oracle/11.2/client64/precomp/admin/pcscfg.cfg

PCC-F-02081, CMD-LINE: Unterminated option value list or value list was truncat
ed.

thanks,
Thein
Re: does proc precompile gtk libraries? [message #564010 is a reply to message #563952] Mon, 20 August 2012 02:58 Go to previous messageGo to next message
dws1
Messages: 14
Registered: July 2012
Junior Member
This could be Pro*C bug 4149809, which hasn't been fixed yet:

Syntax error at line 1, column 12, file test2.pc:
Error at line 1, column 12 in file test2.pc
#define m(a...) f()
...........1
PCC-S-02014, Encountered the symbol "..." when expecting one of the
following:

, )
The symbol ")" was substituted for "..." to continue.

Error at line 0, column 0 in file test2.pc
PCC-F-02102, Fatal error while doing C preprocessing


You can use the precompiler-defined symbol ORA_PROC to make Pro*C skip problematic includes; suppose you are #including gmessages.h directly, which you probably aren't, but this will illustrate the solution:

#ifndef ORA_PROC
#include "gmessages.h"
#endif
Re: does proc precompile gtk libraries? [message #564011 is a reply to message #564010] Mon, 20 August 2012 03:14 Go to previous messageGo to next message
Michel Cadot
Messages: 59142
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Thanks for the feedback; I have no idea for the moment.
Let us know if you succeed to workaround this problem.

Regards
Michel
Re: does proc precompile gtk libraries? [message #564025 is a reply to message #564011] Mon, 20 August 2012 09:33 Go to previous message
thein
Messages: 9
Registered: February 2012
Junior Member
The way I can work around it is having gtk functions in a separate file: gtkfuncs.c and oracle precompiler functions in a file called sqlfuncs.pc
If I use the script i mentioned previously:

make -f demo_proc_ic.mk build EXE=gtkfuncs OBJS="gtkfuncs.o sqlfuncs.o"

This works. Maybe it can be done another way.

Thanks for your help
Thein


Previous Topic: It's better keep connected to Oracle or it's better reconnect after work?
Next Topic: Data Loading problem of French Input file
Goto Forum:
  


Current Time: Fri Sep 19 04:55:23 CDT 2014

Total time taken to generate the page: 0.10220 seconds