From: Salazar, G. P. <ger...@si...> - 2007-09-07 05:10:20
|
Well, yes, as a matter of fact, we built plplot to generate static = libraries; and I am also compiling a program to staticly link those = libraries. As far as platform and the like info goes, right now I am in Linux; but = I will be doing the same thing for Solaris and Windows. I am using the gcc and g95 compilers in all three platforms. While we are using cmake to compile plplot, I am NOT using it to compile = my own fortran program that uses plplot. After taking a look at one of the files used by plplot, it seems as if = plplot links in all the drivers all the time...so, I started to include = some, too (as hinted by the messages), until all the "undefined = reference" messages disappeared. Here is what I ended up with: g95 -I/usw/ude/Linux/include \ -L/usw/ude/Linux/lib \ -r8 -Bstatic -s -ffixed-line-length-132 -ftrace=3Dfull \ -o try try.f \ -lplplotf77d -lplplotf77cd -lplplotd \ -lgd \ -ltcl8.4 \ -ltk8.4 \ -lhpdf \ -lm \ -lcsirocsa Directory /usw/ude/Linux is where we install our third party software, = like plplot. Basically, the libraries that I thought I should not need but had to add = anyway are: -lgd \ -ltcl8.4 \ -ltk8.4 \ -lhpdf \ Who knows, eventually, I may have to add other things like the ones that = show up in the files used by plplot: png, z, jpeg, xwin, X11, Xext, SM = and ICE...I think I will know when, except for SM and ICE...what is = that? So, that's that, and if that's the way plplot works, fine; it does not = seem ideal, but now I know. So, it looks like I am in business. Thanks for the feedback. Germ=E1n=20 =20 -----Original Message----- From: Alan W. Irwin [mailto:ir...@be...]=20 Sent: Thursday, September 06, 2007 4:18 PM To: Salazar, German P21322 Cc: plp...@li... Subject: Re: [Plplot-general] Compiling a program: undefined reference On 2007-09-06 15:12-0400 Salazar, German P21322 wrote: > : undefined reference to `gdImageLine' > /usw/ude/Linux/lib/libplplotd.a(gd.o)(.text+0xbe0): In function > `fill_polygon': > > ...and the list goes on. > > Questions: > > Why is it trying to use all these drivers if I am only using "psc" = from > Fortran? > Is it possible that plplotd.a was not properly randomized and somehow > when I link it, I link the entire file? > > Pointers would be much appreciated. Please give details of what you did, i.e., cmake command-line options = and full cmake output at minimum. Also, identify your platform and be = specific about the "compile process" you are using. In the absence of those details, I can only guess what the issue is. It appears from above that you have done a static library build for PLplot which is a non-default configuration which we don't test very much. So = you may have inadvertently found some external build issue for that case. = But please give the details requested above so I can replicate the static = build issue here and fix it. If you did not specifically go out of your way to specify a static = library build, then cmake probably found something missing on your system that forced that. To avoid that result, pay close attention to any warnings = you get from cmake concerning shared libraries and address the issue so you = can build shared libraries for PLplot. Shared libraries are our most = thoroughly tested configuration. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and = Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state = implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting = software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads = of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |