Compiling a very simply c programm using a library

From: Andreas Hoeschler (ahoesch@smartsoft.de)
Date: Thu May 02 2002 - 03:52:31 EDT


Hi all,

I am trying to compile the vey simple program in main.c

#include <FBCAccess/FBCAccess.h>
#include <stdio.h>
#include <stdlib.h> /* for free(3) */
#include <unistd.h> /* for sleep(3) */

int main(int argc, const char *argv[])
{
     fbcInitialize();
     printf("Example complete\n");
     return 0;
}

with the following command.

        gcc -I/opt/FrontBase/include -L/opt/FrontBase/lib main.c -lFBCAccess

The FBCAccess library is installed.

bash-2.03$ ls /opt/FrontBase/lib
FBCAccess.o libFBCAccess.so.1
libFBCAccess.a libFBCAccess.so.1.0

What I get is the following:

bash-2.03$ gcc -I/opt/FrontBase/include -L/opt/FrontBase/lib main.c
-lFBCAccess
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssAccept':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:377:
undefined reference to `accept'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:241:
undefined reference to `getprotobyname'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:248:
undefined reference to `setsockopt'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssSocket':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:332:
undefined reference to `socket'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:241:
undefined reference to `getprotobyname'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:248:
undefined reference to `setsockopt'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssKeepAlive':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:299:
undefined reference to `setsockopt'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssBind':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:322:
undefined reference to `setsockopt'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:346:
undefined reference to `bind'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssConnect':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:358:
undefined reference to `connect'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssListen':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:389:
undefined reference to `listen'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssSend':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:429:
undefined reference to `send'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssSendLength':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:429:
undefined reference to `send'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:429:
undefined reference to `send'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `fssReceive':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:488:
undefined reference to `recv'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssReceiveLength':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:488:
undefined reference to `recv'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssShutdown':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:517:
undefined reference to `shutdown'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssLocalPortNumber':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:589:
undefined reference to `getsockname'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function `setSocket':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:241:
undefined reference to `getprotobyname'
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:248:
undefined reference to `setsockopt'
/opt/FrontBase/lib/libFBCAccess.a(FSSockets.o): In function
`fssSetReuseAddress':
/ibid/home/ph/FrontBase-3.5/FBClient/Client/FSBasic/FSSockets.c:322:
undefined reference to `setsockopt'
collect2: ld returned 1 exit status
bash-2.03$

Any ideas? Has anybody had more success using FBCAccess
(www.frontbase.com) on Solaris 8?

Thanks,

    Andreas
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:16 EDT