Ticket #116 (closed defect: fixed)

Opened 16 months ago

Last modified 15 months ago

cmake cannot link museekd against libxml++

Reported by: Silver Owned by: lbponey
Priority: major Milestone: Release 0.2.0
Component: museek_general Version: 0.2prerelease (newnet2 branch)
Keywords: Cc: silver.salonen@…

Description

I'm trying to build Museek+ 0.2 (SVN 1026) on FreeBSD. Concerning museekd, it gets built OK, but then:

... [100%] Building CXX object museekd/CMakeFiles/museekd.dir/distributedsocket.cpp.o Linking CXX executable museekd /usr/bin/ld: cannot find -lxml++-2.6 *** Error code 1

Concerning libxml++, cmake seems to find it OK - before building:

... -- checking for one of the modules 'libxml++-2.6' -- found libxml++-2.6, version 2.22.0

Attachments

CMakeCache.txt Download (18.8 KB) - added by Silver 16 months ago.
CMakeCache_without-DCMAKE_LIBRARY_PATH.txt Download (18.7 KB) - added by Silver 16 months ago.

Change History

Changed 16 months ago by lbponey

  • status changed from new to assigned

Have you checked that libxml++ is correctly installed?

Changed 16 months ago by Silver

Yes, it is: I have /usr/local/lib/libxml++-2.6.so, /usr/local/include/libxml++-2.6 etc. Cmake finds it initially too:

-- checking for one of the modules 'libxml++-2.6' -- found libxml++-2.6, version 2.22.0

Changed 16 months ago by lbponey

It seems to be again a problem with the files being installed in /usr/local/. Can you try adding this to the cmake command? (you might need to delete cmake cache files)

-DCMAKE_LIBRARY_PATH=/usr/local/lib

And can you also try to replace "-DCMAKE_REQUIRED_INCLUDES=/usr/local/include" by "-DCMAKE_INCLUDE_PATH=/usr/local/include" and see if the iconv problem reappears?

Thanks!

Changed 16 months ago by Silver

I tried both -DCMAKE_LIBRARY_PATH=/usr/local/lib and -DCMAKE_REQUIRED_LIBRARIES=/usr/local/lib, but neither didn't help in this case.

Changing -DCMAKE_REQUIRED_INCLUDES to -DCMAKE_INCLUDE_PATH made the iconv problem reappear indeed.

Changed 16 months ago by lbponey

Can you try with:

-DCMAKE_LIBRARY_PATH=/usr/local

and

-DCMAKE_INCLUDE_PATH=/usr/local

(you might need to delete cmake cache files) thanks

Changed 16 months ago by Silver

-DCMAKE_INCLUDE_PATH=/usr/local causes the iconv problem to reappear and -DCMAKE_LIBRARY_PATH=/usr/local doesn't change anything.

Maybe the problem isn't that libxml++ isn't found (-- found libxml++-2.6, version 2.22.0), but rather that how it's found - shouldn't it be smth like "-llibxml++-2.6"?

Changed 16 months ago by lbponey

I don't know... -lxml++-2.6 is ok though, this is what is used on linux (returned by "pkg-config --libs libxml++-2.6"). Have you tried symlinking libs from /usr/local/lib in /usr/lib?

The -DCMAKE_INCLUDE_PATH is not a problem. I thought it would be more adapted than -DCMAKE_REQUIRED_LIBRARIES, but if it doesn't work... let's stick with -DCMAKE_INCLUDE_PATH!

Changed 16 months ago by Silver

Now I did try linking all the libxml++ libraries in /usr/lib, but still nothing :(

But you meant sticking with -DCMAKE_REQUIRED_LIBRARIES, right? As it was the only one that worked concerning iconv.h.

Changed 16 months ago by lbponey

Yes, stick with -DCMAKE_REQUIRED_LIBRARIES! I'll look into libxml++ problem.

Changed 16 months ago by lbponey

hum. sorry, I think I said something stupid yesterday... stick with "-DCMAKE_REQUIRED_INCLUDES=/usr/local/include"!

Can you attach your CMakeCache.txt file?

Changed 16 months ago by Silver

Changed 16 months ago by anonymous

Hehe, yes, now I noticed the mistake you did. I attached the CMakeCache.txt now.

Changed 16 months ago by lbponey

thanks! Was it generated with -DCMAKE_REQUIRED_LIBRARIES or -DCMAKE_LIBRARY_PATH? If yes, I'd also like a cmakecache generated without.

Changed 16 months ago by lbponey

Oh, and can you give me the output of this command:

ls -l /usr/local/lib/libxml*

Changed 16 months ago by Silver

$ ls -l /usr/local/lib/libxml* -rw-r--r-- 1 root wheel 233086 Oct 6 17:35 /usr/local/lib/libxml++-2.6.a -rwxr-xr-x 1 root wheel 1122 Oct 6 17:35 /usr/local/lib/libxml++-2.6.la lrwxr-xr-x 1 root wheel 17 Oct 6 17:35 /usr/local/lib/libxml++-2.6.so -> libxml++-2.6.so.2 -rwxr-xr-x 1 root wheel 169210 Oct 6 17:35 /usr/local/lib/libxml++-2.6.so.2 -rw-r--r-- 1 root wheel 1434134 Nov 20 10:34 /usr/local/lib/libxml2.a -rwxr-xr-x 1 root wheel 838 Nov 20 10:34 /usr/local/lib/libxml2.la lrwxr-xr-x 1 root wheel 12 Nov 20 10:34 /usr/local/lib/libxml2.so -> libxml2.so.5 -rwxr-xr-x 1 root wheel 1328356 Nov 20 10:34 /usr/local/lib/libxml2.so.5 -rw-r--r-- 1 root wheel 33048 Sep 7 10:11 /usr/local/lib/libxmlparse.a -rwxr-xr-x 1 root wheel 844 Sep 7 10:11 /usr/local/lib/libxmlparse.la lrwxr-xr-x 1 root wheel 16 Sep 7 10:11 /usr/local/lib/libxmlparse.so -> libxmlparse.so.1 -rwxr-xr-x 1 root wheel 38520 Sep 7 10:11 /usr/local/lib/libxmlparse.so.1 -rw-r--r-- 1 root wheel 103404 Sep 7 10:11 /usr/local/lib/libxmltok.a -rwxr-xr-x 1 root wheel 830 Sep 7 10:11 /usr/local/lib/libxmltok.la lrwxr-xr-x 1 root wheel 14 Sep 7 10:11 /usr/local/lib/libxmltok.so -> libxmltok.so.1 -rwxr-xr-x 1 root wheel 102678 Sep 7 10:11 /usr/local/lib/libxmltok.so.1

Changed 16 months ago by Silver

Changed 15 months ago by Silver

Hello again.

The problem is resolved now. I just set appropriate values for LDFLAGS and CONFIGURE_ENV while building. Now the basic flags look like this:

LDFLAGS+= -L/usr/local/lib CMAKE_ARGS+= -DCMAKE_REQUIRED_INCLUDES="/usr/local/include" CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

Changed 15 months ago by lbponey

Great! Thanks for working on this! I'm going to update the wiki. Just to be sure: you define those 3 flags before calling cmake? is that right? LDFLAGS+= -L/usr/local/lib

then

CMAKE_ARGS+= -DCMAKE_REQUIRED_INCLUDES="/usr/local/include"

then

CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"

and then

cmake [...]

And now that you've built it, does everything works ok on freebsd?

Changed 15 months ago by Silver

I haven't actually built it yet - the process makes my machine terribly slow, so I'm setting up a separate machine for building, installing and testing it fully.

And actually I use FreeBSD ports' system to build/install it, but now I tried compiling it by hand, and that should do it under FreeBSD:

$ mkdir build && cd build

$ export LDFLAGS=-L/usr/local/lib

$ export CONFIGURE_ENV=LDFLAGS="${LDFLAGS}"

$ cmake ../ -DCMAKE_REQUIRED_INCLUDES="/usr/local/include"

Changed 15 months ago by Silver

I've now completed initial packaging of Museek 0.2 for FreeBSD. It build and installs just OK and seems to work OK too. I'll give feedback through tickets if I discover any issues through the extensive use.

Changed 15 months ago by lbponey

  • status changed from assigned to closed
  • resolution set to fixed

Ok, thanks for your work!

Add/Change #116 (cmake cannot link museekd against libxml++)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.