OVH Cloud OVH Cloud

Problème de compilation

2 réponses
Avatar
lists
Bonjour à tous,

J'essaie de compiler la librarie TSE3 sous MacOS X 10.2.
<http://tse3.sourceforge.net>

J'ai une erreur que je n'arrive pas à résoudre : un grand nombre de
"multiple definitions of symbol" de la forme :

ld: multiple definitions of symbol
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&)
./util/.libs/libtse3util.al(Track.lo) definition of
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&) in section (__TEXT,__text)
./util/.libs/libtse3util.al(Track.lo) definition of
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&) in section (__TEXT,__text)

Ce que je ne comprends pas c'est que ça vient du même fichier objet.
De plus, la fonction en question est définie une seule fois :

% find . -name "*.cpp" -type f -exec grep Track_UnremoveParts {} \;
-print
Util::Track_UnremoveParts(newTrack, part->start(),
part->end(),
./src/tse3/cmd/Part.cpp
void Util::Track_UnremoveParts(Track *track,
./src/tse3/util/Track.cpp

La fonction est donc définie dans Track.cpp et utilisée dans Part.cpp.

Une idée ?

--
Julien Salort
http://www.juliensalort.org

2 réponses

Avatar
jmm
11.10.2003 19:37, Julien Salort wrote:
Bonjour à tous,

J'essaie de compiler la librarie TSE3 sous MacOS X 10.2.
<http://tse3.sourceforge.net>

J'ai une erreur que je n'arrive pas à résoudre : un grand nombre de
"multiple definitions of symbol" de la forme :

ld: multiple definitions of symbol
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&)
../util/.libs/libtse3util.al(Track.lo) definition of
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&) in section (__TEXT,__text)
../util/.libs/libtse3util.al(Track.lo) definition of
TSE3::Util::Track_RemoveParts(TSE3::Track*, TSE3::Clock, TSE3::Clock,
std::vector<TSE3::Part*, std::allocator<TSE3::Part*> >&, TSE3::Clock&,
TSE3::Clock&, TSE3::Part*&) in section (__TEXT,__text)

Ce que je ne comprends pas c'est que ça vient du même fichier objet.
De plus, la fonction en question est définie une seule fois :

% find . -name "*.cpp" -type f -exec grep Track_UnremoveParts {} ;
-print
Util::Track_UnremoveParts(newTrack, part->start(),
part->end(),
../src/tse3/cmd/Part.cpp
void Util::Track_UnremoveParts(Track *track,
../src/tse3/util/Track.cpp

La fonction est donc définie dans Track.cpp et utilisée dans Part.cpp.

Une idée ?

j'ai fait une tentative et c'est pas mieux...


/bin/sh ../../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -
I../../../src -g -O2 -W -Wall -ansi -pedantic -c -o Song.lo `test -f
'Song.cpp' || echo './'`Song.cpp
g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../src -g -O2 -W -Wall -
ansi -pedantic -c Song.cpp -MT Song.lo -MD -MP -MF .deps/Song.TPlo -fno-
common -DPIC -o Song.lo
Song.cpp: In function `void TSE3::File::write(TSE3::File::XmlFileWriter&,
TSE3::Song&)':
Song.cpp:18: call of overloaded `element(const char[9], size_t)' is
ambiguous
./../../src/tse3/file/XML.h:155: candidates are: void
TSE3::File::XmlFileWriter::element(const std::string&, int)
./../../src/tse3/file/XML.h:156: void
TSE3::File::XmlFileWriter::element(const std::string&, unsigned int)
./../../src/tse3/file/XML.h:157: void
TSE3::File::XmlFileWriter::element(const std::string&, bool)
make[4]: *** [Song.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Il faut peut-être faire la recherche d'un autre sequ.

--
JMM

Remplacer "NoSpam" par "free" dans mon adresse pour répondre
Replace "NoSpam" by "free" in my address to reply

Avatar
lists
jmm wrote:

j'ai fait une tentative et c'est pas mieux...

/bin/sh ../../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I.
-I../../.. - I../../../src -g -O2 -W -Wall -ansi -pedantic -c -o
Song.lo `test -f 'Song.cpp' || echo './'`Song.cpp g++ -DHAVE_CONFIG_H -I.
-I. -I../../.. -I../../../src -g -O2 -W -Wall - ansi -pedantic -c Song.cpp
-MT Song.lo -MD -MP -MF .deps/Song.TPlo -fno- common -DPIC -o Song.lo
Song.cpp: In function `void TSE3::File::write(TSE3::File::XmlFileWriter&,
TSE3::Song&)': Song.cpp:18: call of overloaded `element(const char[9],
size_t)' is ambiguous ./../../src/tse3/file/XML.h:155: candidates are:
void TSE3::File::XmlFileWriter::element(const std::string&, int)
./../../src/tse3/file/XML.h:156: void
TSE3::File::XmlFileWriter::element(const std::string&, unsigned int)
./../../src/tse3/file/XML.h:157: void
TSE3::File::XmlFileWriter::element(const std::string&, bool) make[4]: ***
[Song.lo] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: ***
[all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: ***
[all] Error 2

Il faut peut-être faire la recherche d'un autre sequ.


J'ai eu aussi cette erreur mais il suffit d'ajouter un caster l'argument
en size_t en (unsigned int) pour choisir explicitement le prototype.

C'est l'erreur de linkage qui m'embête, je ne sais pas comment la
corriger (puisque le symbole semble provenir du même fichier objet). En
fait je ne comprends pas ce qui se passe.

--
Julien Salort
http://www.juliensalort.org