Why is gcc interpreting this as single option only? - powershell

I'm trying to compile a gtk program on PowerShell so that I can use pkg-config's output as input to gcc but gcc is taking the whole output as a single command line option and return the error:
gcc.exe: error: unrecognized command line option '-mms-bitfields
-pthread -mms-bitfields -IC:/gtk/include/gtk-3.0 -IC tk/include/cairo -IC:/gtk/include -IC:/gtk/include/pango-1.0 -IC:/gtk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk clude/pixman-1 -IC:/gtk/include -IC:/msys/opt/include -IC:/msys/opt/include/freetype2 -IC:/msys/opt/include -IC:/msys t/include/libpng16 -IC:/gtk/include -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng16 -IC:/gtk/in de/gdk-pixbuf-2.0 -IC:/gtk/include/libpng16 -IC:/gtk/include/glib-2.0 -IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgt -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lz -lpangowin32-1.0 -lp ocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl'
the command line I'm using:
gcc hello.c -o hello $(pkg-config.exe --cflags --libs gtk+-3.0)
I've also tried:
$(gcc hello.c -o hello $(pkg-config.exe --cflags --libs gtk+-3.0))
either return same result. How do I fix this?

It seems that pkg-config.exe --cflags --libs gtk+-3.0 command return its output as single line and thus in PowerShell it is parsed as single string object. And when string with spaces (actual rule more complex and version dependent) passed to native application, then PowerShell tries to be helpful and add quotes, so it be interpreted as single argument. One way to prevent it is to use '--%' "operator":
gcc hello.c -o hello '--%' $(pkg-config.exe --cflags --libs gtk+-3.0)
Note that it is not actually --% operator, so it not make rest of the line to be interpreted literally. Actually it is just string with value --%.
The "magic" happens because when PowerShell command line builder for native applications encounter --% string it disables automatic quoting for arguments with spaces for any remaining arguments. And it also passes them thru [Environment]::ExpandEnvironmentVariables to resolve environment variables in %VariableName% form.

Related

Cannot compile Nim file using GTK+ 3

I 'm newbie.(And I cannot speak English better.)
I'm trying compile Nim code using gtk
{.push header:"<gtk/gtk.h>",varargs.}
proc gtk_init(argc,argv:pointer=nil)
proc gtk_window_new(typ:int):pointer
proc gtk_main_quit
proc gtk_widget_show(win:pointer)
proc gtk_main
{.pop.}
var maindow:pointer
gtk_init()
maindow=gtk_window_new(0)
maindow.gtk_widget_set_size_request(300,200)
maindow.gtk_widget_show()
gtk_main()
I'm using this command ->
nim c -r test
However,It couldn't succeed.
fatal error: gtk/gtk.h: No such file or directory
#include <gtk/gtk.h>
^~~~~~~~~~~
compilation terminated.
I already installed libgtk-3-dev ,but didn't solved the problem.
(so I don't know that syntax of the code is correct.)
What should I do for compile it?
When you use GTK from a C program, you have to pass the correct include directories with -I and the correct linked libraries with -l. Usually, these are obtained by calling pkg-config:
$ pkg-config --cflags gtk+-3.0
-pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
$ pkg-config --libs gtk+-3.0
-lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
Thus, to tell Nim to pass the right flags to the C compiler and linker, you can do the following:
{.passc: staticExec("pkg-config --cflags gtk+-3.0").}
{.passl: staticExec("pkg-config --libs gtk+-3.0").}
{.push header:"<gtk/gtk.h>",varargs.}
proc gtk_init(argc,argv:pointer=nil)
proc gtk_window_new(typ:int):pointer
proc gtk_main_quit
proc gtk_widget_show(win:pointer)
proc gtk_main
{.pop.}
var maindow:pointer
gtk_init()
...
Such usage of GTK wouldn't be very typical though. You may find it easeir to just use an existing wrapper such as nim-gtk3.

Error in Makefile calling sed with comment character

I'm trying to build lstrip, a Lua utility for compressing Lua source code. I'm trying to build for Lua 5.1.3 on OS X v10.10.3.
I have downloaded and extracted the Lua 5.1.3 source code and modified the Makefile for lstrip to point to this directory. However, when I run make, I get this output:
cc -I/usr/local/src/lua-5.1.3/src -I/usr/local/src/lua-5.1.3/src -O2 -Wall -Wextra -O2 -c -o lstrip.o lstrip.c
lstrip.c:33:14: warning: unused parameter 'argc' [-Wunused-parameter]
int main(int argc, char* argv[])
^
1 warning generated.
sed '/void luaX_next/i#include "proxy.c"' /usr/local/src/lua-5.1.3/src/llex.c > llex.c
sed: 1: "/void luaX_next/i#inclu ...": command i expects \ followed by text
make: *** [llex.c] Error 1
This is what the relevant Makefile command looks like:
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
I think that this is because the # in the sed command is being treated like an actual comment, but I'm not sure.
How can I fix the Makefile, or manually run the steps, to get lstrip built?
Full copy of the Makefile follows, in case it matters:
# makefile for lstrip
# change these to reflect your Lua installation (Lua 5.1!)
LUA= /usr/local/src/lua-5.1.3
LUAINC= $(LUA)/src
LUALIB= $(LUA)/src
LUASRC= $(LUA)/src
# no need to change anything below here
CFLAGS= $(INCS) $(WARN) -O2 $G
WARN= -O2 -Wall -Wextra
INCS= -I$(LUAINC) -I$(LUASRC)
LIBS= -L$(LUALIB) -llua -lm
MYNAME= lstrip
MYLIB= $(MYNAME)
T= $(MYNAME)
OBJS= $(MYNAME).o llex.o
TEST= test.lua
all: test
test: $T
$T $(TEST)
$T: $(OBJS)
$(CC) -o $# $(OBJS) $(LIBS)
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
llex.o: proxy.c
clean:
-rm -f $(OBJS) core core.* a.out $(MYNAME)
# eof
Hand-build solution:
cp /usr/local/src/lua-5.1.3/src/llex.c .
Hand-edit llex.c to add the line #include "proxy.c" before the line starting with void luaX_next (line 446 for me).
Now run make, which will succeed.
You can find the answer in the sed manual, and it is in the Makefile lines
llex.c:
sed '/void luaX_next/i#include "proxy.c"' $(LUASRC)/$# > $#
Some variable expansion takes place here:
$(LUASRC) is expanded to the variable set above -> $(LUA)/src. Recurse as needed.
$# is replaced with the current target (llex.c)
So this recipe says:
In order to obtain the target llex.c (which will be processed later through other recipes), apply a stream editing command to the file $LUASRC/llex.c and write it to llex.c.
The stream editing command is: look for text "void luaX_next", before printing it, insert line "#include "proxy.c"".
Problem is, the command to do this is not "i" but "i\(newline)", which conflicts with a requirement of Makefiles that recipes must be on a single line.
I suspect that in order to fix your Makefile you need to use a different command than sed; awk can fit the bill although it's a bit more complex.
This line works in Mac OS X and in Linux:
sed '/void luaX_next/{h;s/.*/#include "proxy.c"/;p;g;}' $(LUASRC)/$# > $#

Not able to link libsvn_delta-1.a when compiling svn_swig_perl in msys

Trying to compile perl svn binding for msys. But when compiling the swig perl lib_core.dll it complains reference not found for _svn_delta_noop_window_handler and _svn_delta_default_editor in libsvn_swig_perl-1.a. Both function coming from libsvn_delta-1.a.
I should recompile and make sure the libsvn_swig_perl-1.a properly link with libsvn_delta-1.a? Or it doesn't matter as long as during building lib_core.dll it can link the missing static library?
I really have no idea how to solve this issue.
below are the full log when compile the lib_core.dll:
ld2 -s core.o -o blib/arch/auto/SVN/_Core/_Core.dll \
/usr/lib/perl5/5.8.8/msys/CORE/libperl.dll.a -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/bindings/swig/perl/libsvn_swig_perl/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_client/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_delta/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_repos/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_wc/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_diff/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_subr/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_local/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_svn/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_neon/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_util/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_fs/.libs -lsvn_client-1 -lsvn_delta-1 -lsvn_fs-1 -lsvn_ra-1 -lsvn_repos-1 -lsvn_wc-1 -lsvn_diff-1 -lsvn_subr-1 -lsvn_fs_util-1 -lsvn_swig_perl-1 -lapr-1 -lintl -lz -laprutil-1 -lexpat -lperl -L/lib/perl5/5.8.8/msys/CORE \
gcc -shared -o _Core.dll -Wl,--out-implib=lib_Core.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 -Wl,--enable-auto-image-base \
-s core.o /usr/lib/perl5/5.8.8/msys/CORE/libperl.dll.a -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/bindings/swig/perl/libsvn_swig_perl/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_client/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_delta/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_repos/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_wc/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_diff/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_subr/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_local/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_svn/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_neon/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_util/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_fs/.libs -lsvn_client-1 -lsvn_delta-1 -lsvn_fs-1 -lsvn_ra-1 -lsvn_repos-1 -lsvn_wc-1 -lsvn_diff-1 -lsvn_subr-1 -lsvn_fs_util-1 -lsvn_swig_perl-1 -lapr-1 -lintl -lz -laprutil-1 -lexpat -lperl -L/lib/perl5/5.8.8/msys/CORE
Creating library file: lib_Core.dll.a
/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/bindings/swig/perl/libsvn_swig_perl/.libs/libsvn_swig_perl-1.a(swigutil_pl.o.b): In function `thunk_apply_textdelta':
/usr/src/subversion16/subversion-1.6.17-3-msys-src/subversion-1.6.17/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:703: undefined reference to `_svn_delta_noop_window_handler'
/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/bindings/swig/perl/libsvn_swig_perl/.libs/libsvn_swig_perl-1.a(swigutil_pl.o.b): In function `svn_delta_make_editor':
/usr/src/subversion16/subversion-1.6.17-3-msys-src/subversion-1.6.17/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:785: undefined reference to `_svn_delta_default_editor'
collect2: ld returned 1 exit status
perlld: *** system() failed to execute
gcc -shared -o _Core.dll -Wl,--out-implib=lib_Core.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--stack,8388608 -Wl,--enable-auto-image-base \
-s core.o /usr/lib/perl5/5.8.8/msys/CORE/libperl.dll.a -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/bindings/swig/perl/libsvn_swig_perl/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_client/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_delta/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_repos/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_wc/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_diff/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_subr/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_local/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_svn/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_ra_neon/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_util/.libs -L/usr/src/subversion16/subversion-1.6.17-3-msys-src/bld/subversion/libsvn_fs_fs/.libs -lsvn_client-1 -lsvn_delta-1 -lsvn_fs-1 -lsvn_ra-1 -lsvn_repos-1 -lsvn_wc-1 -lsvn_diff-1 -lsvn_subr-1 -lsvn_fs_util-1 -lsvn_swig_perl-1 -lapr-1 -lintl -lz -laprutil-1 -lexpat -lperl -L/lib/perl5/5.8.8/msys/CORE
My question already answer by other post. Its the linker order issue. Check the answer below:
Linker order
I just need to move around the linker for svn_swig_perl to link it before svn_delta to solve the problem.

perl-DBI / perl-DBD-oracle installation

What I want to do is connecting and retrieving data from oracle database through perl.
What i did(as oracle account) is like below.....
$ rpm -qa|grep DBI
perl-DBI-1.52-2.el5
$ wget http://search.cpan.org/CPAN/authors/id/P/PY/PYTHIAN/DBD-Oracle-1.17.tar.gz
$ tar -zxf DBD-Oracle-1.17.tar.gz
$ cd DBD-Oracle-1.17
$ perl Makefile.PL
Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.008008 on linux (x86_64-linux-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems.
Using Oracle in /sw/oracle/app/oracle/product/102
DEFINE _SQLPLUS_RELEASE = "1002000500" (CHAR)
Oracle version 10.2.0.5 (10.2)
Found /sw/oracle/app/oracle/product/102/rdbms/demo/demo_rdbms.mk
Using /sw/oracle/app/oracle/product/102/rdbms/demo/demo_rdbms.mk
Your LD_LIBRARY_PATH env var is set to '/sw/oracle/app/oracle/product/102/lib:/usr/lib:/sw/oracle/app/oracle/product/102/lib32:.'
Reading /sw/oracle/app/oracle/product/102/rdbms/demo/demo_rdbms.mk
Reading /sw/oracle/app/oracle/product/102/rdbms/lib/env_rdbms.mk
Attempting to discover Oracle OCI build rules
gcc -c -o DBD_ORA_OBJ.o DBD_ORA_OBJ.c
by executing: [make -f /sw/oracle/app/oracle/product/102/rdbms/demo/demo_rdbms.mk build ECHODO=echo ECHO=echo GENCLNTSH='echo genclntsh' CC=true OPTIMIZE= CCFLAGS= EXE=DBD_ORA_EXE OBJS=DBD_ORA_OBJ.o]
Oracle oci build command:
[true -L/sw/oracle/app/oracle/product/102/lib/ -L/sw/oracle/app/oracle/product/102/rdbms/lib/ -o DBD_ORA_EXE DBD_ORA_OBJ.o -lclntsh `cat /sw/oracle/app/oracle/product/102/lib/sysliblist` -ldl -lm -lpthread]
Found header files in /sw/oracle/app/oracle/product/102/rdbms/public.
Checking for functioning wait.ph
Constant subroutine __USE_POSIX undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 8.
Constant subroutine __USE_POSIX2 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 9.
Constant subroutine __USE_POSIX199309 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 10.
Constant subroutine __USE_POSIX199506 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 11.
Constant subroutine __USE_XOPEN undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 12.
Constant subroutine __USE_XOPEN_EXTENDED undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 13.
Constant subroutine __USE_UNIX98 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 14.
Constant subroutine __USE_LARGEFILE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 16.
Constant subroutine __USE_LARGEFILE64 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 17.
Constant subroutine __USE_FILE_OFFSET64 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 18.
Constant subroutine __USE_BSD undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 19.
Constant subroutine __USE_SVID undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 20.
Constant subroutine __USE_MISC undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 21.
Constant subroutine __USE_GNU undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 23.
Constant subroutine __USE_REENTRANT undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 24.
Constant subroutine _POSIX_SOURCE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 49.
Constant subroutine _POSIX_C_SOURCE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 51.
Constant subroutine _XOPEN_SOURCE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 53.
Constant subroutine _XOPEN_SOURCE_EXTENDED undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 55.
Constant subroutine _LARGEFILE64_SOURCE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 57.
Constant subroutine _LARGEFILE_SOURCE undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 104.
Constant subroutine __USE_ISOC99 undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 108.
Constant subroutine __GNU_LIBRARY__ undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/features.ph line 156.
Operator or semicolon missing before &__inline at (eval 167) line 1.
Ambiguous use of & resolved as operator & at (eval 167) line 1.
Constant subroutine __need_size_t undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/stddef.ph line 148.
Scalar found where operator expected at (eval 241) line 1, near "'int' $__val"
(Missing operator before $__val?)
Number found where operator expected at (eval 245) line 1, near ") 0"
(Missing operator before 0?)
Number found where operator expected at (eval 246) line 1, near ") 1"
(Missing operator before 1?)
Number found where operator expected at (eval 247) line 1, near ") 2"
(Missing operator before 2?)
Constant subroutine __need_timespec undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/time.ph line 49.
Hexadecimal number > 0xffffffff non-portable at (eval 447) line 1.
Hexadecimal number > 0xffffffff non-portable at (eval 448) line 1.
Constant subroutine __need_timeval undefined at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/bits/time.ph line 23.
System: perl5.008008 linux builder10.centos.org 2.6.18-53.el5 #1 smp mon nov 12 02:14:55 est 2007 x86_64 x86_64 x86_64 gnulinux
Compiler: gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm
Linker: /usr/bin/ld
Sysliblist: -ldl -lm -lpthread -lnsl -lirc
Oracle makefiles would have used these definitions but we override them:
CC: $(COMPDIR)/bin/gcc
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O3 $(CDEBUG) -m32 -trigraphs -fPIC -I/sw/oracle/app/oracle/product/102/rdbms/demo -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/plsql/public -I/sw/oracle/app/oracle/product/102/network/public -DLINUX -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -fno-strict-aliasing $(LPFLAGS) $(USRFLAGS)]
LDFLAGS: $(LDFLAGS32)
[-m32 -o $# -L/sw/oracle/app/oracle/product/102/rdbms//lib32/ -L/sw/oracle/app/oracle/product/102/lib32/ -L/sw/oracle/app/oracle/product/102/lib32/stubs/]
Linking with OTHERLDFLAGS = -L/sw/oracle/app/oracle/product/102/lib/ -L/sw/oracle/app/oracle/product/102/rdbms/lib/ -lclntsh `cat /sw/oracle/app/oracle/product/102/lib/sysliblist` -ldl -lm -lpthread [from 'build' rule]
Checking if your kit is complete...
Looks good
LD_RUN_PATH=/sw/oracle/app/oracle/product/102/lib:/sw/oracle/app/oracle/product/102/rdbms/lib
Using DBD::Oracle 1.17.
Using DBD::Oracle 1.17.
Using DBI 1.52 (for perl 5.008008 on x86_64-linux-thread-multi) installed in /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle
*** If you have problems...
read all the log printed above, and the README and README.help.txt files.
(Of course, you have read README by now anyway, haven't you?)
$ make
cp Oracle.pm blib/lib/DBD/Oracle.pm
cp oraperl.ph blib/lib/oraperl.ph
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp Oraperl.pm blib/lib/Oraperl.pm
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm
cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm
/usr/bin/perl -p -e "s/~DRIVER~/Oracle/g" /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI/Driver.xst > Oracle.xsi
/usr/bin/perl /usr/lib/perl5/5.8.8/ExtUtils/xsubpp -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap Oracle.xs > Oracle.xsc && mv Oracle.xsc Oracle.c
gcc -c -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/rdbms/demo -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/plsql/public -I/sw/oracle/app/oracle/product/102/network/public -I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.5\" Oracle.c
Oracle.c: In function 'XS_DBD__Oracle__db_ora_lob_append':
Oracle.xs:201: warning: unused variable 'startp'
gcc -c -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/rdbms/demo -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/plsql/public -I/sw/oracle/app/oracle/product/102/network/public -I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.5\" dbdimp.c
dbdimp.c: In function 'ora_db_login6':
dbdimp.c:652: warning: value computed is not used
dbdimp.c: In function 'dbd_rebind_ph_char':
dbdimp.c:1052: warning: value computed is not used
gcc -c -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/rdbms/demo -I/sw/oracle/app/oracle/product/102/rdbms/public -I/sw/oracle/app/oracle/product/102/plsql/public -I/sw/oracle/app/oracle/product/102/network/public -I/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBI -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DVERSION=\"1.17\" -DXS_VERSION=\"1.17\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE" -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\"10.2.0.5\" oci8.c
oci8.c: In function 'fetch_func_rset':
oci8.c:626: warning: value computed is not used
oci8.c: In function 'dbd_rebind_ph_lob':
oci8.c:711: warning: value computed is not used
oci8.c: In function 'ora_blob_read_mb_piece':
oci8.c:778: warning: comparison is always false due to limited range of data type
oci8.c: In function 'ora_describe':
oci8.c:1267: warning: comparison is always false due to limited range of data type
oci8.c: In function 'post_execute_lobs':
oci8.c:2118: warning: value computed is not used
oci8.c: At top level:
oci8.c:563: warning: 'fetch_func_nty' defined but not used
Running Mkbootstrap for DBD::Oracle ()
chmod 644 Oracle.bs
rm -f blib/arch/auto/DBD/Oracle/Oracle.so
gcc -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic Oracle.o dbdimp.o oci8.o -L/sw/oracle/app/oracle/product/102/lib/ -L/sw/oracle/app/oracle/product/102/rdbms/lib/ -lclntsh `cat /sw/oracle/app/oracle/product/102/lib/sysliblist` -ldl -lm -lpthread -o blib/arch/auto/DBD/Oracle/Oracle.so \
\
chmod 755 blib/arch/auto/DBD/Oracle/Oracle.so
cp Oracle.bs blib/arch/auto/DBD/Oracle/Oracle.bs
chmod 644 blib/arch/auto/DBD/Oracle/Oracle.bs
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" ora_explain.PL ora_explain
Extracted ora_explain from ora_explain.PL with variable substitutions.
cp ora_explain blib/script/ora_explain
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/ora_explain
Manifying blib/man1/ora_explain.1
Manifying blib/man3/DBD::Oracle.3pm
Manifying blib/man3/DBD::Oraperl.3pm
$ make install
Warning: You do not have permissions to install into /usr/share/man/man1 at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 114.
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
$ sudo - chmod 777 /usr/share/man
Warning: You do not have permissions to install into /usr/bin at /usr/lib/perl5/5.8.8/ExtUtils/Install.pm line 114.
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
$ sudo - chmod 777 /usr/bin
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
$ perl -e 'use DBD::Oracle'
install_driver(Oracle) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: /sw/oracle/app/oracle/product/102/lib/libnnz10.so: cannot restore segment prot after reloc: Permission denied at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./ora_dump.pl line 7
I've checked permission of /sw/oracle/app/oracle/product/102/lib/libnnz10.so.
My machine is on CentOS release 5.5 and 10g Enterprise Edition Release 10.2.0.5.0...
What am I missing?
Sounds like an issue with SELinux. Try disabling it and see if this resolves your problem:
http://www.crypt.gen.nz/selinux/disable_selinux.html
I do not know what you are missing and where you are going wrong. But I always follow below method and it has worked 100% times for me. Try this method and if it does not work, then I can definitely make it work for you....
One thing I notice in your post is that you are getting permissions issues. Try running these steps as root.
My environment: Oracle 11G running on remote box
My desktop: ubunt/fedora/RHEL/CenOS
I have implemented this on all above 4 flavors of Linux and they all work perfectly.
Here are the steps (Follow 'em the sequence given):
Install Perl DBI module
install below 3 rpm for oracle instant client from http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
oracle-instantclient11.2-basic-11.2.0.3.0-1
oracle-instantclient11.2-devel-11.2.0.3.0-1
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1
I am using 64 bit linux box, so choose your RPM accordingly.
set below variables:
LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
ORACLE_HOME=/usr/lib/oracle/11.2/client64
also add ORACLE_HOME to your PATH variable
download DBD::Oracle ver 1.44 from CPAN.
untar the module and run below commands in given sequence:
perl Makefile.PL
make make
install
DONE !!!

SCons: GCC Ignoring -c

I'm using a MinGW-based GCC cross-compiler to compile a project which uses SCons as its build system.
The Python is a native 2.6.2 version, not specifically compiled for MinGW (or Cygwin).
However, I am running into a problem with the build:
F:/pedigree/compilers/bin/i686-elf-gcc -o build\src\user\applications\apptest\ma
in.obj -c -std=gnu99 -march=i486 -fno-builtin -m32 -g0 -O3 -Wno-long-long -Wnest
ed-externs -Wall -Wextra -Wpointer-arith -Wcast-align -Wwrite-strings -Wno-long-
long -Wno-variadic-macros -Wno-unused -Wno-unused-variable -Wno-conversion -Wno-
format -Wno-empty-body -fno-stack-protector -DTHREADS -DDEBUGGER -DDEBUGGER_QWER
TY -DSERIAL_IS_FILE -DECHO_CONSOLE_TO_SERIAL -DKERNEL_NEEDS_ADDRESS_SPACE_SWITCH
-DADDITIONAL_CHECKS -DBITS_32 -DKERNEL_STANDALONE -DVERBOSE_LINKER -DX86 -DX86_
COMMON -DLITTLE_ENDIAN -D__UD_STANDALONE__ -DINSTALLER -Isrc\subsys\posix\includ
e -Ibuild\src\user\applications\apptest -Isrc\user\applications\apptest src\user
\applications\apptest\main.c
f:/pedigree/compilers/bin/../lib/gcc/i686-elf/4.4.1/../../../../i686-elf/bin/ld.
exe: crt0.o: No such file: No such file or directory
If I add -c to the CFLAGS, I get a compiled object called "main.obj -c" (there's a space between obj and -c there).
Does anyone have any idea what's happening? Is there anything I can do to solve this?
The project uses the POSIX platform to enforce progarm and object file extensions, however the POSIX platform in SCons defines a function "escape":
def escape(arg):
"escape shell special characters"
slash = '\\'
special = '"$()'
arg = string.replace(arg, slash, slash+slash)
for c in special:
arg = string.replace(arg, c, slash+c)
return '"' + arg + '"'
When it escapes the backslashes, it wreaks havoc in the Windows environment. Changing to a neutral platform, and specifying the extensions explicitly, fixes the problem.