LinuxQuestions.org
Review your favorite Linux distribution.
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-07-2017, 12:51 AM   #1
poplinux
Member
 
Registered: May 2012
Posts: 111

Rep: Reputation: Disabled
How to use '-Wl,-rpath" on build time?


Dear Sir.

My code is very simple, But occured the error on build time.

Library location : /home/myhome/project/lib/libpci.so.3
Header location : /home/myhome/project/include/pci/pci.h
build location : /home/myhome/project/

source
Code:
#define index shadow_workaround_index
#include <pci/pci.h>
struct pci_access *pacc;
struct pci_dev *dev = {0};
int main(int argc, char **argv)
{
  (void) argc;
  (void) argv;
  pacc = pci_alloc();
  dev = pci_get_dev(pacc, dev->domain, dev->bus, dev->dev, 1); 
  return 0;
}
build
Code:
gcc -I/home/myhome/project/include -Wl,-rpath=/home/myhome/project/lib -o out out.c -L/home/myhome/project/lib -lpci

error message
Code:
$ > make
..
..
/bin/ld: cannot find -lpci
What happen to me???
Please advise to me.

Thank you.
 
Old 03-07-2017, 09:53 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,876
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I'd try taking out the -rpath term. And verify that you have a file named libpci.so in your /home/myhome/project/lib directory.
 
Old 03-07-2017, 06:27 PM   #3
poplinux
Member
 
Registered: May 2012
Posts: 111

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
I'd try taking out the -rpath term. And verify that you have a file named libpci.so in your /home/myhome/project/lib directory.
You're right.

Thank you.
 
  


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
try using -rpath or -rpath-link knobby67 Programming 5 11-12-2015 02:04 PM
my LFS build is not responding to "Daylight Savings Time" GameCodingNinja Linux From Scratch 5 11-02-2015 11:55 PM
[SOLVED] Another compilation error (plasma-runtime). -rpath -rpath-link davepi Gentoo 1 08-21-2012 09:04 AM
LXer: rPath on Red Hat's appliance strategy: "Some assembly required" LXer Syndicated Linux News 0 11-10-2007 03:30 PM
kernel build says build is "dirty"? Quakeboy02 Debian 3 12-18-2006 11:24 PM

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

All times are GMT -5. The time now is 05:24 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