staging.inyokaproject.org

Fehler beim Linken von id3v2

Status: Ungelöst | Ubuntu-Version: Ubuntu 17.04 (Zesty Zapus)
Antworten |

jms3000

Avatar von jms3000

Anmeldungsdatum:
29. Januar 2015

Beiträge: 880

Ich wollte mir mal id3v2 selbst kompilieren. Ich habe dazu vorher die libid3 und libz übersetzt und "installiert". Jetzt kommt der folgende Fehler beim Linken. Den kann ich mir nicht erklären, denn er findet die libid3, daran kannst nicht liegen.

1
c++ -v -L/usr/local/lib -pedantic -Wall -lz -lid3 -Wl,-t -o id3v2 convert.o list.o id3v2.o genre.o
/usr/bin/ld: mode elf_x86_64
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o
-lz (/usr/local/lib/libz.so)
-lid3 (/usr/local/lib/libid3.so)
convert.o
list.o
id3v2.o
genre.o
-lstdc++ (/usr/lib/gcc/x86_64-linux-gnu/6/libstdc++.so)
/lib/x86_64-linux-gnu/libm.so.6
/lib/x86_64-linux-gnu/libmvec.so.1
libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so.1)
/lib/x86_64-linux-gnu/libc.so.6
(/usr/lib/x86_64-linux-gnu/libc_nonshared.a)elf-init.oS
(/usr/lib/x86_64-linux-gnu/libc_nonshared.a)stat.oS
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_s.so.1)
/usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
Using built-in specs.
COLLECT_GCC=c++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 6.3.0-12ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2) 
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-L/usr/local/lib' '-Wpedantic' '-Wall' '-o' 'id3v2' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper -plugin-opt=-fresolution=/tmp/ccz54smV.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o id3v2 /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o -L/usr/local/lib -L/usr/lib/gcc/x86_64-linux-gnu/6 -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../.. -lz -lid3 -t convert.o list.o id3v2.o genre.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
convert.o: In function `DeleteTag(int, char**, int, int)':
convert.cpp:(.text+0xfb): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
convert.cpp:(.text+0x157): undefined reference to `ID3_Tag::Clear()'
convert.cpp:(.text+0x18a): undefined reference to `ID3_Tag::Link(char const*, unsigned short)'
convert.cpp:(.text+0x1b0): undefined reference to `ID3_Tag::Strip(unsigned short)'
convert.cpp:(.text+0x1e3): undefined reference to `ID3_Tag::Strip(unsigned short)'
convert.cpp:(.text+0x216): undefined reference to `ID3_Tag::Strip(unsigned short)'
convert.cpp:(.text+0x26a): undefined reference to `ID3_Tag::~ID3_Tag()'
convert.cpp:(.text+0x289): undefined reference to `ID3_Tag::~ID3_Tag()'
convert.o: In function `ConvertTag(int, char**, int)':
convert.cpp:(.text+0x319): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
convert.cpp:(.text+0x375): undefined reference to `ID3_Tag::Clear()'
convert.cpp:(.text+0x3a8): undefined reference to `ID3_Tag::Link(char const*, unsigned short)'
convert.cpp:(.text+0x3bc): undefined reference to `ID3_Tag::Update(unsigned short)'
convert.cpp:(.text+0x3fe): undefined reference to `ID3_Tag::~ID3_Tag()'
convert.cpp:(.text+0x41d): undefined reference to `ID3_Tag::~ID3_Tag()'
list.o: In function `PrintInformation(char*, ID3_Tag const&)':
list.cpp:(.text+0x1bd): undefined reference to `ID3_Tag::CreateIterator() const'
list.cpp:(.text+0x1de): undefined reference to `ID3_Tag::NumFrames() const'
list.cpp:(.text+0x289): undefined reference to `ID3_Frame::GetDescription() const'
list.cpp:(.text+0x2b7): undefined reference to `ID3_Frame::GetTextID() const'
list.cpp:(.text+0x308): undefined reference to `ID3_Frame::GetID() const'
list.cpp:(.text+0x354): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x3c6): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x4c5): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x4e0): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x597): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.o:list.cpp:(.text+0x5b2): more undefined references to `ID3_GetString(ID3_Frame const*, ID3_FieldID)' follow
list.o: In function `PrintInformation(char*, ID3_Tag const&)':
list.cpp:(.text+0x7fb): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0x84b): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID, unsigned long)'
list.cpp:(.text+0x8e0): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x8fb): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x916): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0x931): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0x95d): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xab7): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xacf): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xae7): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xaff): undefined reference to `ID3_Frame::GetField(ID3_FieldID) const'
list.cpp:(.text+0xc14): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xc2c): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xcc7): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xd1d): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xd35): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xd5e): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xdf8): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
list.cpp:(.text+0xe10): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.cpp:(.text+0xe39): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
list.o: In function `ListTag(int, char**, int, int)':
list.cpp:(.text+0x126d): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
list.cpp:(.text+0x12ed): undefined reference to `ID3_Tag::Link(char const*, unsigned short)'
list.cpp:(.text+0x139c): undefined reference to `ID3_Tag::~ID3_Tag()'
list.cpp:(.text+0x13bf): undefined reference to `ID3_Tag::~ID3_Tag()'
id3v2.o: In function `PrintVersion(char*)':
id3v2.cpp:(.text+0x4f8): undefined reference to `ID3LIB_FULL_NAME'
id3v2.o: In function `main':
id3v2.cpp:(.text+0x112e): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
id3v2.cpp:(.text+0x1283): undefined reference to `ID3_Tag::Link(char const*, unsigned short)'
id3v2.cpp:(.text+0x12c0): undefined reference to `ID3_Frame::ID3_Frame(ID3_FrameID)'
id3v2.cpp:(.text+0x132f): undefined reference to `ID3_Frame::SetID(ID3_FrameID)'
id3v2.cpp:(.text+0x135b): undefined reference to `ID3_Tag::Find(ID3_FrameID) const'
id3v2.cpp:(.text+0x13cc): undefined reference to `ID3_Tag::RemoveFrame(ID3_Frame const*)'
id3v2.cpp:(.text+0x1407): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1450): undefined reference to `ID3_Tag::AttachFrame(ID3_Frame*)'
id3v2.cpp:(.text+0x1477): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x153a): undefined reference to `ID3_Tag::RemoveFrame(ID3_Frame const*)'
id3v2.cpp:(.text+0x154e): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1597): undefined reference to `ID3_Tag::AttachFrame(ID3_Frame*)'
id3v2.cpp:(.text+0x15ce): undefined reference to `ID3_Tag::RemoveFrame(ID3_Frame const*)'
id3v2.cpp:(.text+0x161c): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1677): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x16bb): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x16e8): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1711): undefined reference to `ID3_Tag::AttachFrame(ID3_Frame*)'
id3v2.cpp:(.text+0x1764): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x17e4): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1828): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x186c): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x18b0): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.o:id3v2.cpp:(.text+0x18dd): more undefined references to `ID3_Frame::Field(ID3_FieldID) const' follow
id3v2.o: In function `main':
id3v2.cpp:(.text+0x193b): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1956): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1971): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x198c): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x19e6): undefined reference to `ID3_Tag::RemoveFrame(ID3_Frame const*)'
id3v2.cpp:(.text+0x1a91): undefined reference to `ID3_Tag::Find(ID3_FrameID) const'
id3v2.cpp:(.text+0x1ac7): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1af0): undefined reference to `ID3_Tag::AttachFrame(ID3_Frame*)'
id3v2.cpp:(.text+0x1b13): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1b65): undefined reference to `ID3_Tag::RemoveFrame(ID3_Frame const*)'
id3v2.cpp:(.text+0x1ba0): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1be9): undefined reference to `ID3_Tag::AttachFrame(ID3_Frame*)'
id3v2.cpp:(.text+0x1c02): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1c1d): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1cd4): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1d24): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID, unsigned long)'
id3v2.cpp:(.text+0x1db9): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1dd4): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1def): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1e0a): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1e36): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x1f90): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1fab): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1fc6): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x1fe1): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x2125): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x2140): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x21f8): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x2262): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x227d): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x22a9): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x2355): undefined reference to `ID3_GetString(ID3_Frame const*, ID3_FieldID)'
id3v2.cpp:(.text+0x2370): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x239c): undefined reference to `ID3_Frame::Field(ID3_FieldID) const'
id3v2.cpp:(.text+0x24ca): undefined reference to `ID3_Tag::Update(unsigned short)'
id3v2.cpp:(.text+0x2566): undefined reference to `ID3_Tag::~ID3_Tag()'
id3v2.cpp:(.text+0x25b8): undefined reference to `ID3_Tag::~ID3_Tag()'
/usr/bin/ld: link errors found, deleting executable `id3v2'
collect2: error: ld returned 1 exit status

user_unknown

Avatar von user_unknown

Anmeldungsdatum:
10. August 2005

Beiträge: 17630

Ich habe ewig keine Programme selbst mehr aus den Quellen kompiliert.

Hast Du libid3 unmittelbar vorher selbst installiert? Wenn Du seither nicht neu gebootet hast, musst Du meiner Erinnerung nach dann ein Programm aufrufen, dass den ldlibrary-Path neu läd/aktualisiert. Ich bin da aber, s.o., nicht sicher.

jms3000

(Themenstarter)
Avatar von jms3000

Anmeldungsdatum:
29. Januar 2015

Beiträge: 880

Ich hab jetzt mal ein mini-Beispiel gemacht, zu kompilieren mit "c++ test.cpp":

1
2
3
4
5
6
7
8
#include <id3/tag.h>

int main( int argc, char *argv[])
{
  ID3_Tag myTag;

  return 0;
}

Da kommt auch der Fehler:

/tmp/ccmwV7Ab.o: In function `main':
test.cpp:(.text+0x38): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
test.cpp:(.text+0x4c): undefined reference to `ID3_Tag::~ID3_Tag()'
collect2: error: ld returned 1 exit status

rklm Team-Icon

Projektleitung

Anmeldungsdatum:
16. Oktober 2011

Beiträge: 13242

jms3000 schrieb:

Ich hab jetzt mal ein mini-Beispiel gemacht, zu kompilieren mit "c++ test.cpp":

1
2
3
4
5
6
7
8
#include <id3/tag.h>

int main( int argc, char *argv[])
{
  ID3_Tag myTag;

  return 0;
}

Da kommt auch der Fehler:

/tmp/ccmwV7Ab.o: In function `main':
test.cpp:(.text+0x38): undefined reference to `ID3_Tag::ID3_Tag(char const*)'
test.cpp:(.text+0x4c): undefined reference to `ID3_Tag::~ID3_Tag()'
collect2: error: ld returned 1 exit status

Logisch, Du linkst ja gar nicht gegen libid3.a oder libid3.so.

jms3000

(Themenstarter)
Avatar von jms3000

Anmeldungsdatum:
29. Januar 2015

Beiträge: 880

c++ -Wl,-t -lz -lid3 test.cpp

Antworten |