CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Posts
    2

    My compiler hates me

    OK, so I'm working on a piece (or rather, a few pieces) of code that converts data into a viewable table in HTML/CSS. The data is from a bioinformatics program that uses the bio++ library, and basically all I'm doing is turning a rather haphazard arrangement of data into something readable. I would gladly tell you what the problem is, but the program does not compile so I am a bit less than able to do so. And I would gladly give you the output of the compiler with line number and error message, but it seems to be past that stage and into another stage of grief. To be clear, I'm not a C++ guru, if that isn't obvious, but the majority of the group I work with is C++-illiterate so I'm basically on my own.

    So here's what I'm getting in output from the compiler

    In file included from /usr/include/c++/4.2/backward/fstream.h:31,
    from MySQLFreeFOIT.cpp:3:
    /usr/include/c++/4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    /tmp/ccKO0p0G.o: In function `bpp::Newick::Newick(bool, bool)':
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x1f): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x36): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x4d): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x64): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x80): undefined reference to `VTT for bpp::Newick'
    /tmp/ccKO0p0G.o:MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x9c): more undefined references to `VTT for bpp::Newick' follow
    /tmp/ccKO0p0G.o: In function `bpp::Newick::Newick(bool, bool)':
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x112): undefined reference to `vtable for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x126): undefined reference to `vtable for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x137): undefined reference to `vtable for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x148): undefined reference to `vtable for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x159): undefined reference to `vtable for bpp::Newick'
    /tmp/ccKO0p0G.o:MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x16a): more undefined references to `vtable for bpp::Newick' follow
    /tmp/ccKO0p0G.o: In function `bpp::Newick::Newick(bool, bool)':
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x1ea): undefined reference to `bpp::TreeTools::BOOTSTRAP'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x202): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x227): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x24c): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x26e): undefined reference to `VTT for bpp::Newick'
    MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x290): undefined reference to `VTT for bpp::Newick'
    /tmp/ccKO0p0G.o:MySQLFreeFOIT.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x2b2): more undefined references to `VTT for bpp::Newick' follow
    /tmp/ccKO0p0G.o: In function `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)':
    MySQLFreeFOIT.cpp:(.text._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE6assignEPKcS7_j[boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)]+0x22): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
    /tmp/ccKO0p0G.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
    MySQLFreeFOIT.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC1ES6_S6_RNS_13match_resultsIS6_S9_EERKNS_11basic_regexIcSD_EENS_15regex_constants12_match_flagsES6_[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)]+0xc1): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
    /tmp/ccKO0p0G.o: In function `bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)':
    MySQLFreeFOIT.cpp:(.text._ZN5boost11regex_matchIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SD_RNS_13match_resultsISD_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE[bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)]+0x46): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
    /tmp/ccKO0p0G.o: In function `boost::cpp_regex_traits<char>::transform(char const*, char const*) const':
    MySQLFreeFOIT.cpp:(.text._ZNK5boost16cpp_regex_traitsIcE9transformEPKcS3_[boost::cpp_regex_traits<char>::transform(char const*, char const*) const]+0x30): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
    /tmp/ccKO0p0G.o: In function `boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) const':
    MySQLFreeFOIT.cpp:(.text._ZNK5boost16cpp_regex_traitsIcE17transform_primaryEPKcS3_[boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) const]+0x30): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
    /tmp/ccKO0p0G.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()':
    MySQLFreeFOIT.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE11match_matchEv[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()]+0x179): undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
    /tmp/ccKO0p0G.o: In function `boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const':
    MySQLFreeFOIT.cpp:(.text._ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0x9a): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
    MySQLFreeFOIT.cpp:(.text._ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0x130): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
    /tmp/ccKO0p0G.o: In function `void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)':
    MySQLFreeFOIT.cpp:(.text._ZN5boost9re_detail11raise_errorINS_20regex_traits_wrapperINS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEEEvRKT_NS_15regex_constants10error_typeE[void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)]+0x47): undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
    /tmp/ccKO0p0G.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()':
    MySQLFreeFOIT.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE12extend_stackEv[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()]+0x20): undefined reference to `boost::re_detail::get_mem_block()'
    /tmp/ccKO0p0G.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)':
    MySQLFreeFOIT.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE18unwind_extra_blockEb[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)]+0x48): undefined reference to `boost::re_detail::put_mem_block(void*)'
    collect2: ld returned 1 exit status

    I'm somewhat bewildered. Any thoughts would be much appreciated, I can attach my code, but I was mostly looking for any thoughts on what this collection of errors means. If it's necessary I'll need to comment the code more thoroughly so that it can easily be read. Thank you to anyone who takes any time to answer this.

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: My compiler hates me

    /usr/include/c++/4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
    The above is a warning to tell you that instead of using the pre-standard <fstream.h> and <iostream.h>, you should use <fstream> and <iostream>.

    The other errors seem to be related to some template code, and I am afraid I have not yet developed the skill of parsing such error messages without having the relevant code at hand.

    Try and come up with the smallest and simplest code that demonstrates the problem, then post it here if the process of finding that code did not provide you with the insight to solve your problem yourself.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: My compiler hates me

    Quote Originally Posted by GoblinInventor
    I would gladly tell you what the problem is, but the program does not compile so I am a bit less than able to do so. And I would gladly give you the output of the compiler with line number and error message, but it seems to be past that stage and into another stage of grief. To be clear, I'm not a C++ guru, if that isn't obvious, but the majority of the group I work with is C++-illiterate so I'm basically on my own.
    We cannot determine the error by just those messages. We need to see the actual code. Without code, all we can do is repeat what those messages are saying. If you want it fixed, we need to see the code.

    http://www.parashift.com/c++-faq-lit...t.html#faq-5.8
    I can attach my code,
    Attach a small sample program that produces the same or similar errors. There is no need to attach a full blown application. Whenever you get a compiler error, start here:
    Code:
    #include <whatever you need to include>
    #include <whatever you need to include>
    #include <whatever you need to include>
    //...
    //... some dummy structs, classes, definitions, etc. that mimic what you're doing
    //....
    //.. maybe some dummy functions that exercises the structs/classes
    //...
    int main()
    {
       // code to produce error using dummy functions / structures / etc.
    }
    Regards,

    Paul Mckenzie

  4. #4
    Join Date
    May 2008
    Posts
    2

    Re: My compiler hates me

    OK, so, this is a small chunk of code that will produce the same error. I would make something that was more functional, but the code won't even compile, so it's not possible to test even if it were functional.

    Code:
    #include <bpp/bpp/Bpp-Phyl-1.5.0/Phyl/Tree.h>
    #include <bpp/bpp/Bpp-Phyl-1.5.0/Phyl/Newick.h>
    #include <boost/regex.hpp>
    #include <set>
    #include <map>
    using namespace std;
    using namespace boost;
    using namespace bpp;
    
    typedef map<string, pair<double, string> > DistanceAndProteinSequenceForTaxon;
    typedef map<int, DistanceAndProteinSequenceForTaxon *> TaxonToNodeDistanceAndProteinSequenceMap;	
    
    class Entry { public:
    
                         int leaf_id;
    
                         string taxon;
    
                         string value;
    
                         double distance;
    			string protein;
    			Entry * pointer;
    			int count;
    			 };
    
    
    
    Entry form_entry(int leaf_id, string taxon, string value, string protein, double distance) {
    
    	Entry entry;      
    	entry.leaf_id = leaf_id;
    
          entry.taxon = taxon;
    
          entry.value = value;
    
          entry.distance = distance;
    	entry.protein = protein;
    	entry.count = 1;
    	entry.pointer = 0;
    
          return(entry); }
    
    Entry form_ortholog(int NodeId, string taxon, TaxonToNodeDistanceAndProteinSequenceMap prot_tax_map, bpp::Tree * tree)
    {
          DistanceAndProteinSequenceForTaxon * dist_prot_tax_pointer = prot_tax_map[NodeId];
          DistanceAndProteinSequenceForTaxon dist_prot_tax = *dist_prot_tax_pointer;
          pair<double, string> dist_prot = dist_prot_tax[taxon];
          double dist = dist_prot.first;
          string ortholog = dist_prot.second;
          string questioned_protein = tree->getNodeName(NodeId);
          Entry entry;
          entry = form_entry(NodeId, taxon, ortholog, questioned_protein, dist);
          return(entry);      
    }
    
    bpp::Tree* get_tree(string file) {
    	Newick * newickReader = new Newick(false);	
    	bpp::Tree * tree = newickReader->read(file);
    	return(tree); }
    
    void find_orthologs_in_tree(bpp::Tree * tree) {
      vector<int> leafIds = tree->getLeavesId();
      map<string, int> tree_node_id_of_sequence_id;
      
      regex bpgseq_patt("bpgseq([0-9]+)");
      smatch seq_matches;
      string sequence_ids_clause = "(";
      vector<int>::iterator node_iter;
      for (node_iter = leafIds.begin(); node_iter != leafIds.end(); ++node_iter) {
        if (regex_match(tree->getNodeName(*node_iter), seq_matches, bpgseq_patt)) {
          tree_node_id_of_sequence_id[seq_matches[1]] = *node_iter;
          sequence_ids_clause += seq_matches[1];
          sequence_ids_clause += ",";
        }
      }
    	form_entry(1, "taxon", "value", "protein", 10.0);
    }
    
    int main(int argc, char *argv[]) {
    	if (argc != 1) {
    		cout << "Error"; }
    	else {
    		const char * file = argv[1];	
    		bpp::Tree * tree = get_tree(file);
    		find_orthologs_in_tree(tree); }
    	return(0); }
    and there error is much the same

    /tmp/ccDPB2FT.o: In function `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)':
    Example.cpp:(.text._ZN5boost11basic_regexIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE6assignEPKcS7_j[boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::assign(char const*, char const*, unsigned int)]+0x22): undefined reference to `boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::do_assign(char const*, char const*, unsigned int)'
    /tmp/ccDPB2FT.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)':
    Example.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEC1ES6_S6_RNS_13match_resultsIS6_S9_EERKNS_11basic_regexIcSD_EENS_15regex_constants12_match_flagsES6_[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::perl_matcher(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >)]+0xc1): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)'
    /tmp/ccDPB2FT.o: In function `bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)':
    Example.cpp:(.text._ZN5boost11regex_matchIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS5_EEEcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEbT_SD_RNS_13match_resultsISD_T0_EERKNS_11basic_regexIT1_T2_EENS_15regex_constants12_match_flagsE[bool boost::regex_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)]+0x46): undefined reference to `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match()'
    /tmp/ccDPB2FT.o: In function `boost::cpp_regex_traits<char>::transform(char const*, char const*) const':
    Example.cpp:(.text._ZNK5boost16cpp_regex_traitsIcE9transformEPKcS3_[boost::cpp_regex_traits<char>::transform(char const*, char const*) const]+0x30): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform(char const*, char const*) const'
    /tmp/ccDPB2FT.o: In function `boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) const':
    Example.cpp:(.text._ZNK5boost16cpp_regex_traitsIcE17transform_primaryEPKcS3_[boost::cpp_regex_traits<char>::transform_primary(char const*, char const*) const]+0x30): undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary(char const*, char const*) const'
    /tmp/ccDPB2FT.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()':
    Example.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE11match_matchEv[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()]+0x179): undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > >::maybe_assign(boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > const&)'
    /tmp/ccDPB2FT.o: In function `boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const':
    Example.cpp:(.text._ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0x9a): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
    Example.cpp:(.text._ZNK5boost9re_detail31cpp_regex_traits_implementationIcE12error_stringENS_15regex_constants10error_typeE[boost::re_detail::cpp_regex_traits_implementation<char>::error_string(boost::regex_constants::error_type) const]+0x130): undefined reference to `boost::re_detail::get_default_error_string(boost::regex_constants::error_type)'
    /tmp/ccDPB2FT.o: In function `void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)':
    Example.cpp:(.text._ZN5boost9re_detail11raise_errorINS_20regex_traits_wrapperINS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEEEEEvRKT_NS_15regex_constants10error_typeE[void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > >(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error_type)]+0x47): undefined reference to `boost::re_detail::raise_runtime_error(std::runtime_error const&)'
    /tmp/ccDPB2FT.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()':
    Example.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE12extend_stackEv[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::extend_stack()]+0x20): undefined reference to `boost::re_detail::get_mem_block()'
    /tmp/ccDPB2FT.o: In function `bpp::Newick::Newick(bool, bool)':
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x1f): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x36): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x4d): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x64): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x80): undefined reference to `VTT for bpp::Newick'
    /tmp/ccDPB2FT.o:Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x9c): more undefined references to `VTT for bpp::Newick' follow
    /tmp/ccDPB2FT.o: In function `bpp::Newick::Newick(bool, bool)':
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x112): undefined reference to `vtable for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x126): undefined reference to `vtable for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x137): undefined reference to `vtable for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x148): undefined reference to `vtable for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x159): undefined reference to `vtable for bpp::Newick'
    /tmp/ccDPB2FT.o:Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x16a): more undefined references to `vtable for bpp::Newick' follow
    /tmp/ccDPB2FT.o: In function `bpp::Newick::Newick(bool, bool)':
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x1ea): undefined reference to `bpp::TreeTools::BOOTSTRAP'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x202): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x227): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x24c): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x26e): undefined reference to `VTT for bpp::Newick'
    Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x290): undefined reference to `VTT for bpp::Newick'
    /tmp/ccDPB2FT.o:Example.cpp:(.text._ZN3bpp6NewickC1Ebb[bpp::Newick::Newick(bool, bool)]+0x2b2): more undefined references to `VTT for bpp::Newick' follow
    /tmp/ccDPB2FT.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)':
    Example.cpp:(.text._ZN5boost9re_detail12perl_matcherIN9__gnu_cxx17__normal_iteratorIPKcSsEESaINS_9sub_matchIS6_EEENS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE18unwind_extra_blockEb[boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::unwind_extra_block(bool)]+0x48): undefined reference to `boost::re_detail::put_mem_block(void*)'
    collect2: ld returned 1 exit status

  5. #5
    Join Date
    May 2008
    Posts
    96

    Re: My compiler hates me

    Your latest problem appears to be related to Boost.

    Either you are not #includeing all the required headers to use RegExp or you did not compile it. (Most of Boost is just header files, but not all. You must compile the regexp package before you can use it.)

    I've never used (or heard of) bpp, but those compiler errors seem to be the same kind.

    If you can't compile your libraries then make sure you have configured their paths properly. (In *nix systems this is sometimes a pain. Make sure to use configure properly.)

    Also make sure you are linking with the proper library files when compiling your program. For example, if you are compiling in debug mode, you should be compiling with debug libs. Etc.

    Hope this helps.

  6. #6
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: My compiler hates me

    The compiler is happy. But probably linker "hates" you!

    You need to supply more information for the linker to generate the final exetutable binary. This may include, adding some more source files to your compilation, or the existing library (.so, .lib etc).

    As an example:
    Code:
    int foo(int);
    int main()
    {
    int x = foo(10);
    return 0;
    }
    Here the compiler would be happy, but linker would complain for 'foo'. Now, this 'foo' can be in other source (.CPP) files, or may be in other library. You need to tell the linker about it.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  7. #7
    Join Date
    Nov 2006
    Location
    Australia
    Posts
    1,569

    Re: My compiler hates me

    PLEASE use code tags properly...
    Good judgment is gained from experience. Experience is gained from bad judgment.
    Cosy Little Game | SDL | GM script | VLD | Syntax Hlt | Can you help me with my homework assignment?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured