First remove -Woverloaded-virtual from the makefile to ensure that it isn't causing any problems beyond the warning. Here's a web link that explains how to remove fPIC errors: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3. You might be able to solve the problem just by adding -fPIC as one of the compilation options.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you can see from the listing above I deleted -Woverloaded-virtual flag and added -fPIC flag, but it did'nt solve the problem. I did not find in the link you mentioned above any other methods to solve it then adding -fPIC flag :(
Sincerely,
Ru
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello CLIPS users and team!
Trying to make CLIPSJNI on Ubuntu 8.04 I got this error message:
...
...
-Wstrict-prototypes -Waggregate-return -Wno-implicit utility.c
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
gcc -c -DLINUX -DALLOW_ENVIRONMENT_GLOBALS=0 -std=c99 -Wall -Wundef -Wpointer-arith -Wshadow -Wcast-qual \ -Wcast-align -Winline -Wmissing-declarations -Wredundant-decls \ -Woverloaded-virtual -Wmissing-prototypes -Wnested-externs \ -Wstrict-prototypes -Waggregate-return -Wno-implicit watch.c
cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C
gcc -o libCLIPSJNI.so -shared -Wall -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -lm agenda.o analysis.o argacces.o bload.o bmathfun.o bsave.o classcom.o classexm.o classfun.o classinf.o classini.o classpsr.o clsltpsr.o commline.o conscomp.o constrct.o constrnt.o crstrtgy.o cstrcbin.o cstrccom.o cstrcpsr.o cstrnbin.o cstrnchk.o cstrncmp.o cstrnops.o cstrnpsr.o cstrnutl.o default.o defins.o developr.o dffctbin.o dffctbsc.o dffctcmp.o dffctdef.o dffctpsr.o dffnxbin.o dffnxcmp.o dffnxexe.o dffnxfun.o dffnxpsr.o dfinsbin.o dfinscmp.o drive.o edbasic.o edmain.o edmisc.o edstruct.o edterm.o emathfun.o engine.o envrnmnt.o evaluatn.o expressn.o exprnbin.o exprnops.o exprnpsr.o extnfunc.o factbin.o factbld.o factcmp.o factcom.o factfun.o factgen.o facthsh.o factlhs.o factmch.o factmngr.o factprt.o factqpsr.o factqury.o factrete.o factrhs.o filecom.o filertr.o generate.o genrcbin.o genrccmp.o genrccom.o genrcexe.o genrcfun.o genrcpsr.o globlbin.o globlbsc.o globlcmp.o globlcom.o globldef.o globlpsr.o immthpsr.o incrrset.o inherpsr.o inscom.o insfile.o insfun.o insmngr.o insmoddp.o insmult.o inspsr.o insquery.o insqypsr.o iofun.o lgcldpnd.o memalloc.o miscfun.o modulbin.o modulbsc.o modulcmp.o moduldef.o modulpsr.o modulutl.o msgcom.o msgfun.o msgpass.o msgpsr.o multifld.o multifun.o objbin.o objcmp.o objrtbin.o objrtbld.o objrtcmp.o objrtfnx.o objrtgen.o objrtmch.o parsefun.o pattern.o pprint.o prccode.o prcdrfun.o prcdrpsr.o prdctfun.o prntutil.o proflfun.o reorder.o reteutil.o retract.o router.o rulebin.o rulebld.o rulebsc.o rulecmp.o rulecom.o rulecstr.o ruledef.o ruledlt.o rulelhs.o rulepsr.o scanner.o sortfun.o strngfun.o strngrtr.o symblbin.o symblcmp.o symbol.o sysdep.o textpro.o tmpltbin.o tmpltbsc.o tmpltcmp.o tmpltdef.o tmpltfun.o tmpltlhs.o tmpltpsr.o tmpltrhs.o tmpltutl.o userdata.o userfunctions.o utility.o watch.o CLIPSJNI_Environment.c
/usr/bin/ld: agenda.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
agenda.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libCLIPSJNI.so] Error 1
What I have to do next? Thanks in advance.
Sincerely,
Ru
r
First remove -Woverloaded-virtual from the makefile to ensure that it isn't causing any problems beyond the warning. Here's a web link that explains how to remove fPIC errors: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3. You might be able to solve the problem just by adding -fPIC as one of the compilation options.
Hello Gary,
...
...
-Wstrict-prototypes -Waggregate-return -Wno-implicit userfunctions.c
gcc -c -DLINUX -DALLOW_ENVIRONMENT_GLOBALS=0 -fPIC -std=c99 -Wall -Wundef -Wpointer-arith -Wshadow -Wcast-qual \ -Wcast-align -Winline -Wmissing-declarations -Wredundant-decls \ -Wmissing-prototypes -Wnested-externs \ -Wstrict-prototypes -Waggregate-return -Wno-implicit utility.c
gcc -c -DLINUX -DALLOW_ENVIRONMENT_GLOBALS=0 -fPIC -std=c99 -Wall -Wundef -Wpointer-arith -Wshadow -Wcast-qual \ -Wcast-align -Winline -Wmissing-declarations -Wredundant-decls \ -Wmissing-prototypes -Wnested-externs \ -Wstrict-prototypes -Waggregate-return -Wno-implicit watch.c
gcc -o libCLIPSJNI.so -shared -Wall -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux -lm agenda.o analysis.o argacces.o bload.o bmathfun.o bsave.o classcom.o classexm.o classfun.o classinf.o classini.o classpsr.o clsltpsr.o commline.o conscomp.o constrct.o constrnt.o crstrtgy.o cstrcbin.o cstrccom.o cstrcpsr.o cstrnbin.o cstrnchk.o cstrncmp.o cstrnops.o cstrnpsr.o cstrnutl.o default.o defins.o developr.o dffctbin.o dffctbsc.o dffctcmp.o dffctdef.o dffctpsr.o dffnxbin.o dffnxcmp.o dffnxexe.o dffnxfun.o dffnxpsr.o dfinsbin.o dfinscmp.o drive.o edbasic.o edmain.o edmisc.o edstruct.o edterm.o emathfun.o engine.o envrnmnt.o evaluatn.o expressn.o exprnbin.o exprnops.o exprnpsr.o extnfunc.o factbin.o factbld.o factcmp.o factcom.o factfun.o factgen.o facthsh.o factlhs.o factmch.o factmngr.o factprt.o factqpsr.o factqury.o factrete.o factrhs.o filecom.o filertr.o generate.o genrcbin.o genrccmp.o genrccom.o genrcexe.o genrcfun.o genrcpsr.o globlbin.o globlbsc.o globlcmp.o globlcom.o globldef.o globlpsr.o immthpsr.o incrrset.o inherpsr.o inscom.o insfile.o insfun.o insmngr.o insmoddp.o insmult.o inspsr.o insquery.o insqypsr.o iofun.o lgcldpnd.o memalloc.o miscfun.o modulbin.o modulbsc.o modulcmp.o moduldef.o modulpsr.o modulutl.o msgcom.o msgfun.o msgpass.o msgpsr.o multifld.o multifun.o objbin.o objcmp.o objrtbin.o objrtbld.o objrtcmp.o objrtfnx.o objrtgen.o objrtmch.o parsefun.o pattern.o pprint.o prccode.o prcdrfun.o prcdrpsr.o prdctfun.o prntutil.o proflfun.o reorder.o reteutil.o retract.o router.o rulebin.o rulebld.o rulebsc.o rulecmp.o rulecom.o rulecstr.o ruledef.o ruledlt.o rulelhs.o rulepsr.o scanner.o sortfun.o strngfun.o strngrtr.o symblbin.o symblcmp.o symbol.o sysdep.o textpro.o tmpltbin.o tmpltbsc.o tmpltcmp.o tmpltdef.o tmpltfun.o tmpltlhs.o tmpltpsr.o tmpltrhs.o tmpltutl.o userdata.o userfunctions.o utility.o watch.o CLIPSJNI_Environment.c
/usr/bin/ld: /tmp/ccKUAhH2.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/tmp/ccKUAhH2.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libCLIPSJNI.so] Error 1
r
As you can see from the listing above I deleted -Woverloaded-virtual flag and added -fPIC flag, but it did'nt solve the problem. I did not find in the link you mentioned above any other methods to solve it then adding -fPIC flag :(
Sincerely,
Ru
Try putting the -fPIC flag on the line that links the project as well.
Yes! This is solved the problem. Great! Thank you very much, Gary.
Best regards,
Ru