1833953 Members
1675 Online
110063 Solutions
New Discussion

Compile error

 
CDADDY
Advisor

Compile error

I am attempting to build a program and am getting the error:
/usr/bin/ld: Can't find library Xpm
The file /usr/lib/libXpm.sl does exist, but it was copied from another HP system.

In the Makefile, if I replace "-lXpm" with "/usr/lib/libXpm.sl", the program will build, but this is not an acceptable fix for the problem.

I downloaded and swinstall'ed the file http://hpux.cs.utah.edu/hppd/hpux/X11/Graphics/xpm-3.4k/ , but this didn't solve the problem.

The HP Forum problem: http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x5cd268da2286d711abdc0090277a778c,00.html
subject: Compile error
May 19, 2003 16:04 PM GMT
gave a glimmer of hope (thanks, Regs David), but the error is still there.

I believe that Xpm should have been installed as part of a larger install process, but does anyone know where Xpm should come from? Maybe from Motif???
6 REPLIES 6
Olav Baadsvik
Esteemed Contributor

Re: Compile error



Hello,

Seems like libxpm is a set of functions for
storing/retreiving color bitmaps (X Pixmaps)
It does not come with the standard hp-ux distribution of X11/Motif.
You say that you have a version of libXpm but
that it does not fix the problem.
It could be that the libXpm you have is for
a different version of HP-UX.
I advise you to seach on google to find
source or a correct binary version for the
version of hp-ux and X11 you are using.


Regards
Olav
Steven Gillard_2
Honored Contributor

Re: Compile error

It seems very strange that the program builds correctly when you specify the full path to the library - this indicates that the library is there OK but something is wrong with your LPATH setting.

Is your LPATH environment variable set before you build the program?

Can you provide verbose (-v) output showing the linker step?

Regards,
Steve
CDADDY
Advisor

Re: Compile error

Hello ...

Olav ...

I have searched google for Xpm, but perhaps I need to look more deeply at what I find ...

Steve ...

I substituted "/usr/lib/libXpm.sl" for "-lXpm". Since /usr/lib is the default path, it should have been found, but I set LD_LIBRARY_PATH and LPATH to point to /usr/lib and a UIM/X library, anyway. I still get the error "/usr/bin/ld: Can't find library Xpm". I understand that after a search for the library under LD_LIBRARY, LPATH, and any "-L" options, the default will be searched. I will set LD_LIBRARY and LPATH to point to /usr/lib only, and see what happens.

Thanks, I appreciate your replies ...
Charlie
Umapathy S
Honored Contributor

Re: Compile error

Charles,
My 2 pence.

If you are building 32 bit executable, then you need to set SHLIB_PATH. For 64 bit, LD_LIBRARY_PATH will do.

HTH,
Umapathy


Arise Awake and Stop NOT till the goal is Reached!
Steven Gillard_2
Honored Contributor

Re: Compile error

LPATH will actually override the default, so you do have to be a bit careful with it. Still doesn't explain it if you've got /usr/lib in there....

Perhaps there is a problem with the version of the library in /usr/lib as Olav suggested? Try running chatr or nm on the file and see if any errors are reported.

Also, the hpux.cs.utah.edu version will install under /usr/local/lib/X11, so did you try adding -L/usr/local/lib/X11 to the linker flags in the Makefile?

Cheers,
Steve
CDADDY
Advisor

Re: Compile error

The "Can't find library Xpm" error was corrected by downloading the file xpm-3.4k-sd-10.20.depot.gz and installing it through swinstall. This placed the files libXpm.a and libXpm.sl in the directory /opt/xpm/lib/X11. Once the string "-L/opt/xpm/lib/X11" was used, the build ran successfully. I appreciate all of your help.