link error on serialization demo.cpp
Tried to compile demo.cpp and getting link error below. Any suggestions? g++ -c -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost -I/home/jitsaur/usr/include -g -D_DEBUG -o demo.o demo.cpp g++ -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost -I/home/jitsaur/usr/include -g -D_DEBUG -o demo demo.o demo.o: In function `archive_exception': /home/jitsaur/usr/include/boost/archive/archive_exception.hpp:45: undefined reference to `vtable for boost::archive::archive_exception' ... PLEASE READ: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please delete it and all copies from your system, destroy any hard copies and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Nomura Holding America Inc., Nomura Securities International, Inc, and their respective subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state the views of such entity. Unless otherwise stated, any pricing information in this message is indicative only, is subject to change and does not constitute an offer to deal at any price quoted. Any reference to the terms of executed transactions should be treated as preliminary only and subject to our formal written confirmation.
On Fri, Oct 15, 2010 at 7:41 PM,
Tried to compile demo.cpp and getting link error below. Any suggestions?
g++ -c -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost -I/home/jitsaur/usr/include -g -D_DEBUG -o demo.o demo.cpp
g++ -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost -I/home/jitsaur/usr/include -g -D_DEBUG -o demo demo.o
demo.o: In function `archive_exception':
/home/jitsaur/usr/include/boost/archive/archive_exception.hpp:45: undefined reference to `vtable for boost::archive::archive_exception'
I don't know the answer to this, but here's some thoughts... Serialization (from which archive_exception probably arises) is one of the few non-header-only libraries, so you must have built the library and have it somewhere it will be pickup by the link line. The library must also be mentioned in the link line. All the -I directives in the second line are presumably redundant? I don't think it matters that they're there tho'. Maybe try gcc instead of g++ for the link line. I can't recall the details, and this may produce reems of missing standard library symbol errors, but IIRC g++ and gcc link different libraries. (This point may be completely the wrong way round!) HTH, I'd be inclined to point the finger at the first point. Oh, and read through the getting started guide and make sure all the steps have been followed, or at least that all the build products are present. - Rob.
participants (2)
-
jiryih.tsaur@nomura.com
-
Robert Jones