LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-07-2011, 02:53 PM   #1
daredevil_1981
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Rep: Reputation: Disabled
Compilation issue in c program


Hi friends,

i have c program which compares two files.Its running in solaris .
but now i have to compile the same program in linux RHEL since we are moving to linux .i am using the below command to compile the program.

gcc -o compare.out compare.c -lgen

it throws an error
/usr/bin/ld : cannot find -lgen

help me to sort it out

Thanks in advance
MSK
 
Old 10-07-2011, 03:50 PM   #2
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 840

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
You are trying to link a shared library (libgen.so) which you do not have (at least not where your linker can find it). Try to compile without the -lgen flag
 
Old 10-08-2011, 12:40 AM   #3
daredevil_1981
LQ Newbie
 
Registered: Oct 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
hi millgates,

thanks for the reply .

i tried it without -lgen but it says

(.text+0x39e) : undefined reference to `strfind'
(.text+0x65C) : undefined reference to `strfind'

what is option -lgen and where can i find it .

Thanks in advance,
MSK
 
Old 10-08-2011, 02:40 AM   #4
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 840

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
That means that you use function strfind, but its definition is missing -- it's not in your code or the libraries you link. You need to link the library which contains the strfind function. I've never used the strfind function and I don't know which library is it in. Is it this function?

So either you will have to link a library that contains the function, write the function yourself, or use a different function, such as strstr() from string.h, if it fits you needs.

Quote:
what is option -lgen and where can i find it .
-lgen tells the linker to link a libgen.so library. I think the functionality of libgen is provided by glibc in linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
C program compilation errors pallavibhat89 Programming 7 02-16-2011 01:32 AM
c++ program compilation error yashwantpinge Programming 4 03-17-2006 11:38 PM
c program compilation harun_acs Programming 3 03-18-2004 11:29 AM
Compilation of Program? drdroid Programming 5 12-09-2003 06:41 PM
Compilation is a serious issue!!! nickolse Linux - Software 3 11-03-2003 02:32 AM


All times are GMT -5. The time now is 10:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration