LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2004, 03:17 AM   #1
laikos
Member
 
Registered: Nov 2002
Distribution: Slackware 8.1
Posts: 30

Rep: Reputation: 15
Question Compiling program that use FAM


Hi
I would like to write an application that uses the FAM (fam-2.7.0) to monitor some directory in the linux filesystem. I went to oss.sgi.com/projects/fam and download:
monitor.c
source code. I got fam-2.7.0 installed but when I try to compile monitor.c it give out error linking the program.

Error Message:
root # gcc -o mon monitor.c
/tmp/ccDDZiH4.o(.text+0x94): In function `main':
: undefined reference to `FAMOpen'
/tmp/ccDDZiH4.o(.text+0x153): In function `main':
: undefined reference to `FAMMonitorDirectory'
/tmp/ccDDZiH4.o(.text+0x18c): In function `main':
: undefined reference to `FAMMonitorFile'
/tmp/ccDDZiH4.o(.text+0x1e4): In function `main':
: undefined reference to `FAMCONNECTION_GETfd'
/tmp/ccDDZiH4.o(.text+0x29c): In function `main':
: undefined reference to `FAMNextEvent'
collect2: ld returned 1 exit status

I'm sure it has something to do with the linking but I'm not sure how to fix it. Please help


Thanks
 
Old 03-05-2004, 04:56 AM   #2
stirling
Member
 
Registered: Feb 2004
Distribution: LFS, Ubuntu
Posts: 52

Rep: Reputation: 16
is there a /usr/lib/libfam.*?

then try gcc -lfam -o mon monitor.c
 
Old 03-06-2004, 01:43 PM   #3
laikos
Member
 
Registered: Nov 2002
Distribution: Slackware 8.1
Posts: 30

Original Poster
Rep: Reputation: 15
Hi Stirling,
thanks it got me somewhere, however now I stuck at this point trying to figure out where the function FAMCONNECTION_GETfd' come from.

root # gcc -lfam -o mon monitor.c
/tmp/cc2VxbZZ.o(.text+0x1e4): In function `main':
: undefined reference to `FAMCONNECTION_GETfd'
collect2: ld returned 1 exit status

and

root # ls -al /usr/lib/libfam*
-rw-r--r-- 1 root root 41110 Mar 5 18:30 /usr/lib/libfam.a
-rwxr-xr-x 1 root root 703 Mar 5 18:30 /usr/lib/libfam.la
lrwxrwxrwx 1 root root 15 Mar 5 18:30 /usr/lib/libfam.so -> li
bfam.so.0.0.0
lrwxrwxrwx 1 root root 15 Mar 5 18:30 /usr/lib/libfam.so.0 ->
libfam.so.0.0.0
-rwxr-xr-x 1 root root 35930 Mar 5 18:30 /usr/lib/libfam.so.0.0.0

thanks
 
Old 03-06-2004, 06:26 PM   #4
stirling
Member
 
Registered: Feb 2004
Distribution: LFS, Ubuntu
Posts: 52

Rep: Reputation: 16
change FAMCONNECTION_GETfd to FAMCONNECTION_GETFD in monitor.c
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error while compiling c /c++ program kiranbud Programming 1 10-12-2005 08:19 PM
help compiling a program minm Linux - Newbie 3 10-10-2005 01:14 AM
Compiling a Program? dbzw Linux - Software 4 10-09-2005 01:31 PM
Compiling a program lintho Linux - Software 2 08-24-2004 07:41 AM
Compiling Program Star3132 Linux - General 8 06-29-2004 05:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration