Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Compilation error-Undefined symbol (http://www.go4expert.com/forums/compilation-error-undefined-symbol-t15441/)

smithaivr 8Dec2008 17:59

Compilation error-Undefined symbol

I am facing following error while compiling C code with esql libraries in Solaris 8 machine. Informix version used is Informix 7.2.3. Earlier the same code was compiled in SunOS4.1.3.

Undefined first referenced
symbol in file
_gl_ext_errno /opt/informx7/lib/esql/libsql.a(iqfetch.o)
ASF_FreeNSReg /opt/informx7/lib/esql/libsql.a(iqconnct.o)
gl_mbstimeinfo /opt/informx7/lib/esql/libgen.a(initgls.o)
gl_get_ltime_fmts /opt/informx7/lib/esql/libgen.a(gdtfmt.o)
gl_cv_outbuflen /opt/informx7/lib/esql/libsql.a(iqfetch.o)
gl_full_charoffset /opt/informx7/lib/esql/libsql.a(iqinsert.o)
gl_lc_pieces2lc_spec /opt/informx7/lib/esql/libgen.a(initgls.o)
ld: fatal: Symbol referencing errors. No output written to saw
make: *** exit code 1 making saw

Please help me rectify this error. Thanks in advance!

xpi0t0s 8Dec2008 20:47

Re: Compilation error-Undefined symbol
Do you get any other errors (library not found, for example)?
If not then you just haven't included a library in the link line that defines these symbols.
Tried a quick Google for "gl_mbstimeinfo" but didn't get anything conclusive. Do you have some code somewhere that calls this and the other functions listed in the errors, or are these functions called by a library you're linking with?

smithaivr 8Dec2008 21:43

Re: Compilation error-Undefined symbol
No, I am getting only this error "Undefined symbol". These functions are nowhere in my code but looks like they are in the libraries with which I am linking as you said.

The same code was working fine earlier but with Solaris 4.1.3 and now when I am trying to compile on a different machine(solaris 8) it gives all these informix library file linking error.

xpi0t0s 8Dec2008 22:12

Re: Compilation error-Undefined symbol
Perhaps there's something not installed on this computer that was installed on the previous one. Informix, as an obvious guess, but maybe something else.

Is the previous computer still available? What you could do if it is is to remove one library at a time from the link line where it works fine until you get the same errors, then you'll know which library is missing.

smithaivr 10Dec2008 11:37

Re: Linker error-Undefined symbol

I was able to resolve the earlier error just by including path of those informix7 libraries in my Makefile. But I am getting these errors related to some X windows system libraries. Even if I include these files in Makefile and copy these into current directory, on compiling it gives following linker errors:

Undefined first referenced
symbol in file
XwtexteditWidgetClass /project/abm/r8.0/lib/xultk.a(XuHelp.o)
XwTextClearBuffer /project/abm/r8.0/lib/xultk.a(XuHelp.o)
XwTextInsert /project/abm/r8.0/lib/xultk.a(XuHelp.o)
XwmenubuttonWidgetClass /project/abm/r8.0/lib/libXw.a(Primitive.o)
ld: fatal: Symbol referencing errors. No output written to saw
make: *** exit code 1 making saw

I am compiling it on Solaris 8. Please help me resolve these.


All times are GMT +5.5. The time now is 05:56.