This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: difficulty with c++ boost::thread (1.53.0) on Cygwin 1.7.20(0.266/5/3)

Il 6/30/2013 12:00 AM, Lewis Sternberg ha scritto:

first off, I'm getting "cygcheck: Wrong architecture. Only ix86
executables supported." when running cygcheck.
That said, ...

The attached multithread.cpp ought to run as far as I can tell from
Cygwin, Boost, & the web.
(There is a posting from 2010 regarding problems with building
boost::thread on Cygwin, but I'm able to build, and anyway, the Cygwin
package already includes an up-to-date version of boost::thread.

If I try to compile the attached code thus:
      $  g++ -D THREADED multithread.cpp

no libraries link instruction, so of course "undefined reference"

I get:
      /tmp/ccpBRr49.o:multithread.cpp:(.text+0x259): undefined reference to
      /tmp/ccpBRr49.o:multithread.cpp:(.text+0x263): undefined reference to
      /tmp/ccpBRr49.o:multithread.cpp:(.text+0x26d): undefined reference to
/tmp/ccpBRr49.o: bad reloc address 0xb in
      collect2: ld returned 1 exit status

If I add the option to load libbost_system (as suggested by some threads
on the web):
      $  g++ -D THREADED -llibboost_system multithread.cpp

on MS the linking order is important...

$ g++ -D THREADED  multithread.cpp -l boost_system-mt -l boost_thread-mt

$ ./a.exe
0, 0, 0, 0
0, 3.93049e-06, 0, 0

thank you for your attention and (hopefully) help,


Problem reports:
Unsubscribe info:

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