darkfeline / cantata

Automatically exported from code.google.com/p/cantata
GNU General Public License v3.0
0 stars 0 forks source link

cannot build on FreeBSD with TagLib #589

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of Cantata?

1.5.1

Which build? KDE, Qt4, Qt5, Windows, Ubuntu, Mac?

KDE-4.10.5 FreeBSD-10/amd64

What steps will reproduce the problem?
1. get the 1.5.1 tarball
2. cmake -DCMAKE_INSTALL_PREFIX=/usr/local/cantata 
-DCMAKE_CXX_COMPILER=/usr/local/bin/g++48 -DENABLE_MUSICBRAINZ=OFF .
3. gmake

What is the expected output? What do you see instead?
Build crashes:

[...]
gmake[2]: Leaving directory '/usr/home/emz/src/cantata-1.5.1'
gmake -f tags/CMakeFiles/cantata-tags.dir/build.make 
tags/CMakeFiles/cantata-tags.dir/build
gmake[2]: Entering directory '/usr/home/emz/src/cantata-1.5.1'
Linking CXX executable cantata-tags
cd /home/emz/src/cantata-1.5.1/tags && /usr/local/bin/cmake -E 
cmake_link_script CMakeFiles/cantata-tags.dir/link.txt --verbose=1
/usr/local/bin/g++48   -O3 -DNDEBUG    CMakeFiles/cantata-tags.dir/main.cpp.o 
CMakeFiles/cantata-tags.dir/taghelper.cpp.o 
CMakeFiles/cantata-tags.dir/tags.cpp.o 
CMakeFiles/cantata-tags.dir/filetyperesolver.cpp.o 
CMakeFiles/cantata-tags.dir/__/mpd/song.cpp.o 
CMakeFiles/cantata-tags.dir/moc_taghelper.cxx.o  -o cantata-tags  
-L/usr/local/lib -ltag /usr/local/lib/qt4/libQtGui.so 
/usr/local/lib/qt4/libQtCore.so /usr/local/lib/qt4/libQtNetwork.so 
-Wl,-rpath,/usr/local/lib/qt4: 
CMakeFiles/cantata-tags.dir/tags.cpp.o: In function 
`Tags::setTxxxTag(TagLib::ID3v2::Tag*, std::string const&, std::string const&)':
tags.cpp:(.text+0x1239): undefined reference to 
`TagLib::String::String(std::string const&, TagLib::String::Type)'
tags.cpp:(.text+0x1268): undefined reference to 
`TagLib::String::String(std::string const&, TagLib::String::Type)'
tags.cpp:(.text+0x12b0): undefined reference to 
`TagLib::String::String(std::string const&, TagLib::String::Type)'
CMakeFiles/cantata-tags.dir/tags.cpp.o: In function 
`Tags::setRva2Tag(TagLib::ID3v2::Tag*, std::string const&, double, double)':
tags.cpp:(.text+0x182d): undefined reference to 
`TagLib::String::String(std::string const&, TagLib::String::Type)'
tags.cpp:(.text+0x18a6): undefined reference to 
`TagLib::String::String(std::string const&, TagLib::String::Type)'
CMakeFiles/cantata-tags.dir/tags.cpp.o:tags.cpp:(.text+0x48a6): more undefined 
references to `TagLib::String::String(std::string const&, 
TagLib::String::Type)' follow
collect2: error: ld returned 1 exit status
tags/CMakeFiles/cantata-tags.dir/build.make:218: recipe for target 
'tags/cantata-tags' failed
gmake[2]: *** [tags/cantata-tags] Error 1
gmake[2]: Leaving directory '/usr/home/emz/src/cantata-1.5.1'
CMakeFiles/Makefile2:261: recipe for target 
'tags/CMakeFiles/cantata-tags.dir/all' failed
gmake[1]: *** [tags/CMakeFiles/cantata-tags.dir/all] Error 2
gmake[1]: Leaving directory '/usr/home/emz/src/cantata-1.5.1'
Makefile:137: recipe for target 'all' failed
gmake: *** [all] Error 2

Please provide any additional information below.

I have:

gcc-4.8.3_2
gcc-ecj-4.5
taglib-1.9.1_1

Original issue reported on code.google.com by zhega...@enaza.ru on 17 Nov 2014 at 10:09

GoogleCodeExporter commented 9 years ago
Do you have 2 copies of taglib? The code compiles, but is complaining about 1 
missing function. This sounds like your taglib/tstring.h has the correct 
function listed - but the library file itself (libtag.so) does not. Not sure 
what Cantata can do about this.

Original comment by craig.p....@gmail.com on 17 Nov 2014 at 1:01

GoogleCodeExporter commented 9 years ago
No, I have one.

I even have needed symbols in the library:

[root@bsdrookie:local/lib]# nm -C -D libtag.so.1.14.0 | grep 
'TagLib::String::String('
000000000007f0e0 T TagLib::String::String(char const*, TagLib::String::Type)
000000000007efc0 T TagLib::String::String(wchar_t const*, TagLib::String::Type)
000000000007f490 T TagLib::String::String(TagLib::ByteVector const&, 
TagLib::String::Type)
000000000007e910 T TagLib::String::String(std::__1::basic_string<char, 
std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
TagLib::String::Type)
000000000007ed20 T TagLib::String::String(std::__1::basic_string<wchar_t, 
std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, 
TagLib::String::Type)
000000000007e8e0 T TagLib::String::String(TagLib::String const&)
000000000007f360 T TagLib::String::String(char, TagLib::String::Type)
000000000007e870 T TagLib::String::String()
000000000007f250 T TagLib::String::String(wchar_t, TagLib::String::Type)
000000000007f0e0 T TagLib::String::String(char const*, TagLib::String::Type)
000000000007efc0 T TagLib::String::String(wchar_t const*, TagLib::String::Type)
000000000007f490 T TagLib::String::String(TagLib::ByteVector const&, 
TagLib::String::Type)
000000000007e910 T TagLib::String::String(std::__1::basic_string<char, 
std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
TagLib::String::Type)
000000000007ed20 T TagLib::String::String(std::__1::basic_string<wchar_t, 
std::__1::char_traits<wchar_t>, std::__1::allocator<wchar_t> > const&, 
TagLib::String::Type)
000000000007e8e0 T TagLib::String::String(TagLib::String const&)
000000000007f360 T TagLib::String::String(char, TagLib::String::Type)
000000000007e870 T TagLib::String::String()
000000000007f250 T TagLib::String::String(wchar_t, TagLib::String::Type)

Original comment by zhega...@enaza.ru on 17 Nov 2014 at 1:35

GoogleCodeExporter commented 9 years ago
Sorry, then I dont know what to do. It links perfectly fine under Linux, 
Windows, and OSX. If it's not linking under FreeBSD, then I have no idea as to 
why - I have no access to a FreeBSD system.

Original comment by craig.p....@gmail.com on 17 Nov 2014 at 2:50

GoogleCodeExporter commented 9 years ago
Could you please tell me where Song type is defined ? I managed to find out 
that linking errors are sourced from the mangling incompatibility betweed the 
libtag.so built by clang and cantata built with gcc48, and now I'm trying to to 
build cantata with clang too. For some reason clang doesn't see the Song 
declaration and I cannot find it myself. Thanks. 

Original comment by zhega...@enaza.ru on 18 Nov 2014 at 10:29

GoogleCodeExporter commented 9 years ago
Song is declared in mpd/song.h

Odd that clang is causing errors under FreeBSD, whereas its fine with OSX.

Original comment by craig.p....@gmail.com on 18 Nov 2014 at 2:56

GoogleCodeExporter commented 9 years ago
I have a 

FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.1
Thread model: posix

I got a weird issue with it - the '#include "mpd/song.h"' line was never 
working, I had to change it to '#include "song.h"' line in every file and add 
'-I~/src/cantata-1.5.1/mpd' to CXXFLAGS. Then I got it built. Weird, but other 
includes from mpd directory were seen by clang. Don't know what it is, I'm not 
much of the programmer - to my knowlegle both alternatives are the same thing.

Original comment by zhega...@enaza.ru on 19 Nov 2014 at 6:17

GoogleCodeExporter commented 9 years ago
Please close it, works perfectly. Thanks a lot once again.

Original comment by zhega...@enaza.ru on 19 Nov 2014 at 6:18

GoogleCodeExporter commented 9 years ago
Odd. If you compile without your mods, which files does the error happen with?

At the top of tags/CMakeLists.txt if you change this from:

include_directories(${QTINCLUDES} ${TAGLIB_INCLUDES})

to:

include_directories(${QTINCLUDES} ${TAGLIB_INCLUDES} ${CMAKE_SOURCE_DIR})

Does this help?

Original comment by craig.p....@gmail.com on 19 Nov 2014 at 9:30

GoogleCodeExporter commented 9 years ago
Well, I've added the above anyway.

Original comment by craig.p....@gmail.com on 20 Nov 2014 at 4:54

GoogleCodeExporter commented 9 years ago
Issue 598 has been merged into this issue.

Original comment by craig.p....@gmail.com on 1 Dec 2014 at 2:31