public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Matt Corallo <bitcoin-list@bluematt•me>
To: bitcoin-development@lists•sourceforge.net
Subject: Re: [Bitcoin-development] Unit tests
Date: Sun, 31 Jul 2011 14:24:10 +0200	[thread overview]
Message-ID: <1312115050.2325.1.camel@Desktop666> (raw)
In-Reply-To: <CAJNQ0suWuaeNCA0MDp6Sef4EE1ibSg=YPVWY93cpqKig_reZXg@mail.gmail.com>

On Sun, 2011-07-31 at 11:21 +0000, John Smith wrote:
> 
> BTW, talking about the unit testframework: It doesn't build here by
> default:
> 
> $ make -f makefile.unix test_bitcoin  USE_UPNP=
> 
> g++ -static  -o test_bitcoin  obj/test/test_bitcoin.o -Wl,-Bstatic -l
> boost_system -l boost_filesystem -l boost_program_options -l
> boost_thread -l db_cxx -l ssl -l crypto -Wl,-Bdynamic -l gthread-2.0
> -l z -l dl -l pthread -lboost_unit_test_framework
> /usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In
> function `_start':
> (.text+0x20): undefined reference to `main'
> collect2: ld returned 1 exit status
> make: *** [test_bitcoin] Error 1
> 
> Two ways to fix this:
> 
> 1) Add #define BOOST_TEST_DYN_LINK  to the top of test_bitcoin.cpp.
> This is needed for dynamic linking.
> 
> 2) Link boost_unit_test_framework statically
> 
> test_bitcoin: obj/test/test_bitcoin.o
>         $(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -Wl,-Bstatic
> -lboost_unit_test_framework -Wl,-Bdynamic
> 
> (yes, it needs the switch to dynamic again at the end, otherwise
> libgcc will be linked statically which results in an error ...)
> 
> JS

See pull 363 and 442 :)

Matt




  reply	other threads:[~2011-07-31 12:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJNQ0svOGGZ+L6ffK2RA+wq-VawkdJKeQcjo4_0socLZUpwDyg@mail.gmail.com>
2011-07-31 11:21 ` John Smith
2011-07-31 12:24   ` Matt Corallo [this message]
2011-07-31 12:46     ` John Smith

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=1312115050.2325.1.camel@Desktop666 \
    --to=bitcoin-list@bluematt$(echo .)me \
    --cc=bitcoin-development@lists$(echo .)sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be 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