FU Logo
  • Startseite
  • Kontakt
  • Impressum
  • Home
  • Listenauswahl
  • Anleitungen

Re: [Seqan-dev] Multiple definition problem

<-- thread -->
<-- date -->
  • From: John Reid <j.reid@mail.cryst.bbk.ac.uk>
  • To: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Date: Wed, 06 Feb 2013 22:38:45 +0000
  • Reply-to: SeqAn Development <seqan-dev@lists.fu-berlin.de>
  • Subject: Re: [Seqan-dev] Multiple definition problem

The attached patch seems to fix the problem.

John.


On 06/02/13 22:32, John Reid wrote:
> Hi,
>
> I wonder if the latest svn version is missing some inline definitions.
> If I have two translation units:
>
> #include <seqan.h>
>
> int
> main( int argc, char * argv [] ) {
>     return 0;
> }
>
> and
>
> #include <seqan.h>
>
> which I compile and link into an executable I get multiple definition
> errors:
>
> gcc.compile.c++
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o
>
>     "/home/john/src/stlfilt/gfilt"  -ftemplate-depth-128 -Wno-deprecated
> -Wno-unused -Wno-error -O3 -finline-functions -Wno-inline -Wall -fPIC
> -Wno-deprecated -Wno-unused -DBOOST_FILESYSTEM_VERSION=3
> -DBOOST_SYSTEM_DYN_LINK=1 -DMS_HAS_VALGRIND -DMYRRH_DISABLE_ASSERTS
> -DNDEBUG -DPVAL_LOOKUP -DSEQAN_ENABLE_DEBUG=0 -DSEQAN_ENABLE_TESTING=0
> -DUSING_GOOGLE_PROFILER  -I"." -I"/home/john/Dev/STEME/c++/hmm"
> -I"/home/john/Dev/STEME/c++/myrrh" -I"/home/john/Dev/myrrh"
> -I"/home/john/src/boost/boost_1_51_0"
> -I"/home/john/src/boost/indexing_suite_v2"
> -I"/home/john/src/seqan/new-trunk/trunk/core/include"
> -I"/home/john/src/seqan/new-trunk/trunk/extras/include"
> -I"/usr/local/lib/python2.6/dist-packages/numpy/core/include"
> -I"include" -c -o
> "bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o"
> "sandbox/multiple_defs/translation_unit_1.cpp"
>
> gcc.compile.c++
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o
>
>     "/home/john/src/stlfilt/gfilt"  -ftemplate-depth-128 -Wno-deprecated
> -Wno-unused -Wno-error -O3 -finline-functions -Wno-inline -Wall -fPIC
> -Wno-deprecated -Wno-unused -DBOOST_FILESYSTEM_VERSION=3
> -DBOOST_SYSTEM_DYN_LINK=1 -DMS_HAS_VALGRIND -DMYRRH_DISABLE_ASSERTS
> -DNDEBUG -DPVAL_LOOKUP -DSEQAN_ENABLE_DEBUG=0 -DSEQAN_ENABLE_TESTING=0
> -DUSING_GOOGLE_PROFILER  -I"." -I"/home/john/Dev/STEME/c++/hmm"
> -I"/home/john/Dev/STEME/c++/myrrh" -I"/home/john/Dev/myrrh"
> -I"/home/john/src/boost/boost_1_51_0"
> -I"/home/john/src/boost/indexing_suite_v2"
> -I"/home/john/src/seqan/new-trunk/trunk/core/include"
> -I"/home/john/src/seqan/new-trunk/trunk/extras/include"
> -I"/usr/local/lib/python2.6/dist-packages/numpy/core/include"
> -I"include" -c -o
> "bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o"
> "sandbox/multiple_defs/translation_unit_2.cpp"
>
> gcc.link bin/gcc-4.6/release/seqan_multiple_defs
>
>     "/home/john/src/stlfilt/gfilt"  -Wl,-R
> -Wl,"/home/john/src/boost/boost_1_51_0/bin.v2/libs/regex/build/gcc-4.6/release"
> -Wl,-R
> -Wl,"/home/john/src/boost/boost_1_51_0/bin.v2/libs/system/build/gcc-4.6/release"
> -Wl,-rpath-link
> -Wl,"/home/john/src/boost/boost_1_51_0/bin.v2/libs/regex/build/gcc-4.6/release"
> -Wl,-rpath-link
> -Wl,"/home/john/src/boost/boost_1_51_0/bin.v2/libs/system/build/gcc-4.6/release"
> -o "bin/gcc-4.6/release/seqan_multiple_defs" -Wl,--start-group
> "bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o"
> "bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o"
> "/home/john/src/boost/boost_1_51_0/bin.v2/libs/regex/build/gcc-4.6/release/libboost_regex.so.1.51.0"
> "/home/john/src/boost/boost_1_51_0/bin.v2/libs/system/build/gcc-4.6/release/libboost_system.so.1.51.0" 
> -Wl,-Bstatic  -Wl,-Bdynamic -lprofiler -lrt -Wl,--end-group 
>
>
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::ManToolDocPrinter_::print(std::basic_ostream<char,
> std::char_traits<char> >&, seqan::ToolDoc const&)':
> translation_unit_2.cpp:(.text+0x820): multiple definition of
> `seqan::ManToolDocPrinter_::print(ostream &, seqan::ToolDoc const &)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0x820):
> first defined here
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::_indent(int)':
> translation_unit_2.cpp:(.text+0xcb0): multiple definition of
> `seqan::_indent(int)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0xcb0):
> first defined here
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::_writeCLIElement(std::basic_ofstream<char,
> std::char_traits<char> >&, int, std::basic_string<char, std::char_trait
>     s<char>, std::allocator<char> > const&, std::basic_string<char,
> std::char_traits<char>, std::allocator<char> > const&, bool)':
> translation_unit_2.cpp:(.text+0xd20): multiple definition of
> `seqan::_writeCLIElement(ofstream &, int, string const &, string const
> &, bool)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0xd20):
> first defined here
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::_addUsage(seqan::ToolDoc&, seqan::ArgumentParser const&)':
> translation_unit_2.cpp:(.text+0x1020): multiple definition of
> `seqan::_addUsage(seqan::ToolDoc &, seqan::ArgumentParser const &)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0x1020):
> first defined here
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::TextToolDocPrinter_::print(std::basic_ostream<char,
> std::char_traits<char> >&, seqan::ToolDoc const&)':
> translation_unit_2.cpp:(.text+0x1490): multiple definition of
> `seqan::TextToolDocPrinter_::print(ostream &, seqan::ToolDoc const &)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0x1490):
> first defined here
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_2.o: In
> function `seqan::HtmlToolDocPrinter_::print(std::basic_ostream<char,
> std::char_traits<char> >&, seqan::ToolDoc const&)':
> translation_unit_2.cpp:(.text+0x1b10): multiple definition of
> `seqan::HtmlToolDocPrinter_::print(ostream &, seqan::ToolDoc const &)'
> bin/gcc-4.6/release/sandbox/multiple_defs/translation_unit_1.o:translation_unit_1.cpp:(.text+0x1b10):
> first defined here
> collect2: ld returned 1 exit status
> ...failed updating 1 target...
>
> I'm using gcc 4.6.3 with seqan trunk revision 13539.
>
> Regards,
> John.

Index: core/include/seqan/arg_parse/arg_parse_doc.h
===================================================================
--- core/include/seqan/arg_parse/arg_parse_doc.h	(revision 13539)
+++ core/include/seqan/arg_parse/arg_parse_doc.h	(working copy)
@@ -167,7 +167,7 @@
 // Helper Function _addUsage()
 // ----------------------------------------------------------------------------
 
-void _addUsage(ToolDoc & toolDoc, ArgumentParser const & me)
+inline void _addUsage(ToolDoc & toolDoc, ArgumentParser const & me)
 {
     for (unsigned i = 0; i < length(me._usageText); ++i)
     {
Index: core/include/seqan/arg_parse/arg_parse_ctd_support.h
===================================================================
--- core/include/seqan/arg_parse/arg_parse_ctd_support.h	(revision 13539)
+++ core/include/seqan/arg_parse/arg_parse_ctd_support.h	(working copy)
@@ -182,7 +182,7 @@
 // Function _indent()
 // ----------------------------------------------------------------------------
 
-std::string _indent(const int currentIndent)
+inline std::string _indent(const int currentIndent)
 {
     std::string indent = "";
     for (int i = 0; i < currentIndent; ++i)
@@ -190,7 +190,7 @@
     return indent;
 }
 
-void _writeCLIElement(std::ofstream & ctdfile, int currentIndent, std::string const & optionIdentifier, std::string const & ref_name, bool isList)
+inline void _writeCLIElement(std::ofstream & ctdfile, int currentIndent, std::string const & optionIdentifier, std::string const & ref_name, bool isList)
 {
     ctdfile << _indent(currentIndent)
             << "<clielement optionIdentifier=\"" << optionIdentifier
Index: core/include/seqan/arg_parse/tool_doc.h
===================================================================
--- core/include/seqan/arg_parse/tool_doc.h	(revision 13539)
+++ core/include/seqan/arg_parse/tool_doc.h	(working copy)
@@ -1160,7 +1160,7 @@
 // Function HtmlDocPrinter_::print()
 // --------------------------------------------------------------------------
 
-void HtmlToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
+inline void HtmlToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
 {
     // Print HTML boilerplate header.
     stream << "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\" "
@@ -1250,7 +1250,7 @@
 // Function TextDocPrinter_::print()
 // --------------------------------------------------------------------------
 
-void TextToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
+inline void TextToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
 {
     std::ostream_iterator<char> out(stream);
 
@@ -1316,7 +1316,7 @@
     stream << "Last update " << doc._date << "\n";
 }
 
-void ManToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
+inline void ManToolDocPrinter_::print(std::ostream & stream, ToolDoc const & doc)
 {
     std::ostream_iterator<char> out(stream);
 
<-- thread -->
<-- date -->
  • References:
    • [Seqan-dev] Multiple definition problem
      • From: John Reid <j.reid@mail.cryst.bbk.ac.uk>
  • seqan-dev - February 2013 - Archives indexes sorted by:
    [ thread ] [ subject ] [ author ] [ date ]
  • Complete archive of the seqan-dev mailing list
  • More info on this list...

Hilfe

  • FAQ
  • Dienstbeschreibung
  • ZEDAT Beratung
  • postmaster@lists.fu-berlin.de

Service-Navigation

  • Startseite
  • Listenauswahl

Einrichtung Mailingliste

  • ZEDAT-Portal
  • Mailinglisten Portal