LinuxQuestions.org
Help answer threads with 0 replies.
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 12-10-2012, 04:32 AM   #1
cantordust
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
pgplot linking libraries problem - fedora 17


Hello,

I am trying to install pgplot on a Fedora 17 system, with gfortran. I followed all the steps given on the pgplot website - , including the appropriate edits in the files drivers.list and makefile, after which it seemed to have been 'successfully' installed.

Initially, I could not run ./pgdemo1 (one of the examples given). I solved this by doing this:

Code:
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH
I put the above in the ~/.bashrc file too. When I do this, I am able to run all the demos in the installation directory. However, when I try to run a fortran 90 program which calls pgplot subroutines, the linker is unable to find them. I get the following error message:

Code:
gfortran -o tryplot.e tryplot.f90
/tmp/ccNwjzsG.o: In function `MAIN__':
tryplot.f90:(.text+0xd2): undefined reference to `pgbeg_'
tryplot.f90:(.text+0xfc): undefined reference to `pgenv_'
tryplot.f90:(.text+0x126): undefined reference to `pglab_'
tryplot.f90:(.text+0x148): undefined reference to `pgpt_'
tryplot.f90:(.text+0x152): undefined reference to `pgend_'
collect2: error: ld returned 1 exit status
What am I missing?

I also tried to install using
Code:
yum install pgplot
, after first installing the non-free repositories, and I end up with the same problem.

Any help/suggestions will be greatly appreciated. I'm a newbie to linux and do not understand these structures (libraries and linking etc) well..

Thank you in advance
 
Old 12-10-2012, 05:32 AM   #2
cantordust
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
I was able to resolve the above issue by adding the required libraries during compilation as below:

Code:
gfortran -L/usr/X11R6/lib -lX11 -L/usr/lib -lpgplot -o tryplot.e tryplot.f90
instead of simply

Code:
gfortran -o tryplot.e tryplot.f90
.

If you also use png libraries then you can use:

Code:
gfortran /usr/lib/libpng.so -L/usr/X11R6/lib -lX11 -L/usr/lib -lpgplot -o tryplot.e tryplot.f90
 
1 members found this post helpful.
  


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
[SOLVED] Problem linking with Boost libraries jdwilder Programming 6 04-06-2011 08:04 AM
pgplot shared libraries error tbenavid Linux - Software 1 09-22-2010 11:32 PM
Problem linking static libraries in g++ zbinwu Programming 6 07-26-2007 04:31 PM
problem on linking Xm Xt X11 libraries yaotz Linux - Newbie 9 03-07-2005 11:03 AM
Problem with linking libraries using gcc shortyzms Linux - Software 1 03-29-2004 08:13 PM

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

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