Hi,
I've been trying to compile some libraries so that I can open connections to my Informix 11 server through a TCL shell. So I have two files, one called say db.ec and the other called inftcl.c. inftcl.c contains the TCL commands to do this and db.ec handles using the informix esql libraries to contact the DB server. To do this on Linux I can do something along the following lines:
esql -e db.ec
gcc -c db.c -o db.o
gcc -c inftcl.c -o inftcl.o
Up to this point everything is the same on mac. Then to link to a shared library, say libinftcl I do the followin on Linux:
gcc -shared db.o inftcl.o -o libinftcl.so -shared-libgcc -L/opt/informix/lib -L/opt/informix/lib/esql -lifsql -lifasf -lifgen -lifos -lifgls /opt/informix/lib/esql/checkapi.o -lifglx <non informix includes>
This works fine on Linux but then if I do (what I understand to be the equivalent on OS X):
gcc -dynamiclib db.o inftcl.o -o libinftcl.dylib ....
I get the following warnings and errors:
ld: warning in /opt/informix/lib/esql/libifsql.dylib, file is not of required architecture
ld: warning in /opt/informix/lib/libifasf.dylib, file is not of required architecture
ld: warning in /opt/informix/lib/esql/libifgen.dylib, file is not of required architecture
ld: warning in /opt/informix/lib/esql/libifos.dylib, file is not of required architecture
ld: warning in /opt/informix/lib/esql/libifgls.dylib, file is not of required architecture
ld: warning in /opt/informix/lib/esql/checkapi.o, file is not of required architecture
ld: warning in /opt/informix/lib/esql/libifglx.dylib, file is not of required architecture
Undefined symbols:
"_sqgetdbs", referenced from:
_infGetDbs in db.o
ld: symbol(s) not found
Has anyone come across this kind of thing before? Is there perhaps another way to compile dylib files that might work?
Note that I'm using Informix 11.50 Developer Edition, Mac OS X 10.5.4 and gcc 4.0.1 from XCode 3.0.
Thanks in advance,
Steve