public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "uttamkumar at hotmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/15407] Problem using shared library created from template class Date: Thu, 13 May 2004 11:33:00 -0000 [thread overview] Message-ID: <20040512194325.624.qmail@sourceware.org> (raw) In-Reply-To: <20040512193126.15407.uttamkumar@hotmail.com> ------- Additional Comments From uttamkumar at hotmail dot com 2004-05-12 19:43 ------- (In reply to comment #0) > I have a template class declare in T.hpp and defined in T.cpp and want to build > a shared library and use that library to write an application. Only application > knows about the template(object) type. > g++ -g -D_REENTRANT -frepo -O -W -Wall -Wno-unknown-pragmas -I. -I../h - fPIC - > c T.cpp > It has created the T.rpo repository file. > g++ -frepo -shared -o ../lib/libT.so -fPIC T.o > Now build the app Th. > g++ -g -D_REENTRANT -frepo -O -W -Wall -Wno-unknown-pragmas -I. -I../h - fPIC - > c Th.cpp > It has created the Th.rpo file too. > Now linking: and get the following errro. > g++ Th.o -o Th -L../lib -lT -lpthread -lnsl -lsocket -lstdc++ -l c -l gcc_s > Undefined first referenced > symbol in file > ThreadQueue<Msg>::GetMsg(long) Th.o > ThreadQueue<Msg>::CreateThread(void* (*)(void*), void*)Th.o > ThreadQueue<Msg>::PutMsg(Msg*) Th.o > ThreadQueue<Msg>::ThreadQueue[in-charge](int)Th.o > ld: fatal: Symbol referencing errors. No output written to Th > collect2: ld returned 1 exit status > -------------------------------------------------- > If I use collect2 for linking I get the follwoing error. > collect2 Th.o -o Th -L../lib -l T -lpthread -lnsl -lsocket -lstdc++ -lc - > lgcc_s > collect: recompiling Th.cpp > collect: recompiling T.cpp > T.cpp: In member function `T* ThreadQueue<T>::GetMsg(long int)': > T.cpp:53: warning: `std::vector<T*, std::allocator<T*> >::iterator' > is implicitly a typename > T.cpp:53: warning: implicit typename is deprecated, please see the > documentation for details > collect: recompiling Th.cpp > collect: recompiling ThreadQueue.cpp > and it goes to infinite recompiling loop. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15407
next prev parent reply other threads:[~2004-05-12 19:43 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-05-13 11:26 [Bug c++/15407] New: " uttamkumar at hotmail dot com 2004-05-13 11:33 ` uttamkumar at hotmail dot com [this message] 2004-05-17 19:19 ` [Bug c++/15407] " pinskia at gcc dot gnu dot org 2004-05-21 18:14 ` uttamkumar at hotmail dot com 2004-06-15 20:20 ` [Bug c++/15407] -frepo goes into infinite loop bangerth at dealii dot org 2004-06-15 21:34 ` pinskia at gcc dot gnu dot org 2004-06-16 21:39 ` uttamkumar at hotmail dot com 2004-06-28 15:37 ` nferguso at eso dot org 2004-06-28 18:12 ` uttamkumar at hotmail dot com 2004-09-27 4:23 ` pinskia at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20040512194325.624.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).