This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Always template compilation -frepo etc ...


Hello again all ...

I always have undefined symbole where compiling my prog with -frepo

gcc snapshot from 2001/02/22

here the command line:


> g++ -c -g -frepo src/*.cpp -Iinclude -I$XERCESCROOT/include
> g++ -o foo *.o -L$XERCESCROOT/lib -lxerces-c1_4
collect: recompiling src/log.cpp
collect: recompiling src/log-state.cpp
collect: recompiling src/log-channel.cpp
collect: recompiling src/fs-folder.cpp
collect: recompiling src/fs-file.cpp
collect: recompiling src/file-system.cpp
collect: recompiling src/cmd-line.cpp
collect: recompiling src/app-time.cpp
collect: recompiling src/app-excp.cpp
collect: recompiling src/app-date.cpp
collect: recompiling src/app-app.cpp
collect: relinking
collect: recompiling src/log-state.cpp
collect: recompiling src/app-excp.cpp
collect: recompiling src/app-app.cpp
collect: recompiling src/log.cpp
collect: relinking
collect: recompiling src/log-state.cpp
collect: relinking

Now I've got linking error and some of them refer to template methode which
are used in the library !

src/log-state.cpp:149: undefined reference to
`AppObject::Trace::basic_stream<char, std::char_traits<char> >::
basic_stream(std::string const&)'

some other about std::_Deque_base<std::string, std::allocator<std::string>
>::~_Deque_base()
etc ...
But I go on:

> cd test
test> g++ -c -g -frepo src/excp_test1.cpp -I../include
test> g++ -o excp_test1 excp_test1.o ../*.o -L$XERCESCROOT/lib -lxerces-c1_4
collect: recompiling src/fs-folder.cpp
collect: recompiling src/cmd-line.cpp
collect: recompiling src/app-app.cpp
collect: recompiling src/excp_test1.cpp
collect: relinking
collect: recompiling src/fs-folder.cpp
collect: recompiling src/cmd-line.cpp
collect: recompiling src/excp_test1.cpp
collect: relinking
../log-state.o: In function `AppObject::Trace::State::PrintOn(std::string
const&, std::string const&, unsigned)':
src/log-state.cpp:149: undefined reference to
`AppObject::Trace::basic_stream<char, std::char_traits<char> >::
basic_stream(std::string const&)'
../log-state.o: In function
`std::simple_alloc<std::_Rb_tree_node<std::pair<std::string sont,
std::string> >, std::__malloc_alloc_template<0>
>::deallocate(std::_Rb_tree_node<std::pair<std:string const, std::string>
>*, unsigned)':
/usr/local/include/g++-v3/bits/stl_tree.h(.gnu.linkonce.t._ZNSt5dequeISsSaIS
sEED1Ev+0x48): undefined reference to `std::_Deque_base
<std::string, std::allocator<std::string> >::~Deque_base()'
...

-----------------------------------------------------------------
src/log-state.cpp: 149 :

void
Trace::State::PrintOn( const string& p_channel,
			     const string& p_file_name,
			     unsigned int p_level )
{
....
148  stream_level	l_new_logstream;
149: if ( !(l_new_logstream.first = new Stream_t( p_file_name )) )
150:     throw Sys::NotEnoughMemory;

stream_level is declare like this:
typedef pair<Stream_t*,unsigned int>	stream_level;

Stream_t is declare like this:
typedef AppObject::Trace::basic_stream<char>	Stream_t;

When I don't use the option -frepo all is ok.
Thanks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]