Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-06-2011, 11:32 PM   #1
LQ Newbie
Registered: Dec 2011
Posts: 2

Rep: Reputation: Disabled
/usr/bin/lib cannot find library

I am new to linux, and am trying to get some programs up and running to read .fits files. I'm sure I'm making some rookie mistake, but have been having trouble with the following error message when trying to compile the simple listhead.c demonstration file (not written by me, so it should be free of issues!):

/usr/bin/ld: cannot find -lcfitsio.a
collect2: ld returned 1 exit status

Here is my compile command:

gcc listhead.c -o listhead -I/home/username/Desktop/scftisio/@CFITSIO_PREFIX@/include -L/home/username/Desktop/scftisio/@CFITSIO_PREFIX@/lib -lcfitsio

Where -I/ specifies the path to some necessary files, and (I thought) -L specifies the path to the library folder where libcfitsio.a is (along with its contents, which I extracted to the same folder).

I have also tried setting LDFLAGS:

env LDFLAGS="-L/home/username/Desktop/scftisio/@CFITSIO_PREFIX@/lib"

However, no matter what I try, I consistently receive the above error.

I have tried creating symbolic links to libcfitsio in usr/lib, usr/lib64 and so on, but am unable to do so without root access. And unfortunately, I cannot get the root password for this lab.

For the same reason, I have been unable to edit to include a path to my library.

Like I said, I'm probably making some stupid rookie mistake, can anyone point it out to me, or suggest a better approach that will avoid this error?
Old 12-07-2011, 01:07 AM   #2
LQ Newbie
Registered: Dec 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Simple solution

Ok, looks like this does the trick:

export LDFLAGS=/home/username/Desktop/scftisio/@CFITSIO_PREFIX@/lib

Silly me, that wasn't complicated.


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
LD_LIBRARY_PATH is mentioned with the library path: /usr/bin/ld: cannot find -ljson ven_visu Linux - Software 1 08-05-2011 09:27 AM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM
/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lXpm sqn Linux - Server 2 05-12-2009 03:53 AM
Could anybody please tell how to install [B]mysqlclient.a[/B] library in [B]/usr/lib. krisvamc Linux - Software 5 04-24-2007 04:08 AM
Relationship between /usr/bin and /usr/lib glume Linux - Newbie 4 04-16-2004 08:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 PM.

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