Jamie Lahowetz | 28 May 2012 17:42
Picon

[Mingw-cross-env-list] linking to libboost_thread_win32-mt.a

I'm trying to use the boost_thread libraries in my program and are having troubles linking to the library. Im using autotools to build my project and I keep getting the error
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld: cannot find -lboost_thread_win32-mt.a
So far I have tried setting the LDFLAG in my configure call and specifying -llibboost_thread_win32-mt.a and none of these seem to be working. Any ideas?

--
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Geosciences
402.304.0766
jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Mark Brand | 28 May 2012 23:53
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a


Jamie Lahowetz wrote:
> I'm trying to use the boost_thread libraries in my program and are 
> having troubles linking to the library. Im using autotools to build my 
> project and I keep getting the error
>
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld: 
> cannot find -lboost_thread_win32-mt.a
> So far I have tried setting the LDFLAG in my configure call and 
> specifying -llibboost_thread_win32-mt.a and none of these seem to be 
> working. Any ideas?
>

Hi Jamie,

The flag "-lboost_thread_win32-mt" corresponds to the file 
"usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a". In other words, in 
your linker flag, omit the "lib" prefix and the ".a" suffix.

Mark

Jamie Lahowetz | 29 May 2012 00:39
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a

hope im understanding your reply correctly.
in configure.ac i removed the -l and a.
LIBS="$LIBS libboost_thread_win32-mt"
then ran
./configure --prefix=/home/deadpickle/hprcc_terminal/win32 --host=i686-pc-mingw32 LDFLAGS='-L/home/deadpickle/mxe/usr/i686-pc-mingw32/lib/'
but still received the error
i686-pc-mingw32-g++: error: libboost_thread_win32-mt: No such file or directory


On Mon, May 28, 2012 at 4:53 PM, Mark Brand <mabrand-Caog9qLlAxTz+pZb47iToQ@public.gmane.org> wrote:

Jamie Lahowetz wrote:
I'm trying to use the boost_thread libraries in my program and are having troubles linking to the library. Im using autotools to build my project and I keep getting the error
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld: cannot find -lboost_thread_win32-mt.a
So far I have tried setting the LDFLAG in my configure call and specifying -llibboost_thread_win32-mt.a and none of these seem to be working. Any ideas?


Hi Jamie,

The flag "-lboost_thread_win32-mt" corresponds to the file "usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a". In other words, in your linker flag, omit the "lib" prefix and the ".a" suffix.

Mark







--
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Earth and Atmospheric Sciences
402.304.0766
jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Mark Brand | 29 May 2012 10:18
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a


>         I'm trying to use the boost_thread libraries in my program and
>         are having troubles linking to the library. Im using autotools
>         to build my project and I keep getting the error
>         /home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld:
>         cannot find -lboost_thread_win32-mt.a
>         So far I have tried setting the LDFLAG in my configure call
>         and specifying -llibboost_thread_win32-mt.a and none of these
>         seem to be working. Any ideas?
>

>     The flag "-lboost_thread_win32-mt" corresponds to the file
>     "usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a". In other
>     words, in your linker flag, omit the "lib" prefix and the ".a" suffix.
>

> hope im understanding your reply correctly.
> in configure.ac <http://configure.ac> i removed the -l and a.
> LIBS="$LIBS libboost_thread_win32-mt"
> then ran
> ./configure --prefix=/home/deadpickle/hprcc_terminal/win32 
> --host=i686-pc-mingw32 
> LDFLAGS='-L/home/deadpickle/mxe/usr/i686-pc-mingw32/lib/'
> but still received the error
> i686-pc-mingw32-g++: error: libboost_thread_win32-mt: No such file or 
> directory

Don't omit the "-l" flag. Do omit the "lib" prefix and the ".a" suffix.

Mark

Jamie Lahowetz | 29 May 2012 15:24
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a

Thanks for the reply.
I changed LIBS to LIBS="$LIBS -lboost_thread_win32-mt"
And am now receiving the error:
terminal.o: In function `thread<int (SshClient::*)(int), SshClient*, int>':
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/include/boost/thread/detail/thread.hpp:259: undefined reference to `_imp___ZN5boost6thread12start_threadEv'
terminal.o: In function `ZN10MainWindow12get_stn_infoEv':
/home/deadpickle/hprcc_terminal/src/terminal.cpp:35: undefined reference to `_imp___ZN5boost6threadD1Ev'
I received this before and assumed that it was because I was linking incorrectly. How can we fix it?


On Tue, May 29, 2012 at 3:18 AM, Mark Brand <mabrand-Caog9qLlAxTz+pZb47iToQ@public.gmane.org> wrote:

       I'm trying to use the boost_thread libraries in my program and
       are having troubles linking to the library. Im using autotools
       to build my project and I keep getting the error
       /home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld:
       cannot find -lboost_thread_win32-mt.a
       So far I have tried setting the LDFLAG in my configure call
       and specifying -llibboost_thread_win32-mt.a and none of these
       seem to be working. Any ideas?


   The flag "-lboost_thread_win32-mt" corresponds to the file
   "usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a". In other
   words, in your linker flag, omit the "lib" prefix and the ".a" suffix.


hope im understanding your reply correctly.
in configure.ac <http://configure.ac> i removed the -l and a.

LIBS="$LIBS libboost_thread_win32-mt"
then ran
./configure --prefix=/home/deadpickle/hprcc_terminal/win32 --host=i686-pc-mingw32 LDFLAGS='-L/home/deadpickle/mxe/usr/i686-pc-mingw32/lib/'
but still received the error
i686-pc-mingw32-g++: error: libboost_thread_win32-mt: No such file or directory

Don't omit the "-l" flag. Do omit the "lib" prefix and the ".a" suffix.

Mark




--
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Earth and Atmospheric Sciences
402.304.0766
jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Jamie Lahowetz | 29 May 2012 16:31
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a

Ok got it going. I had to add #define BOOST_THREAD_USE_LIB to the top of my source code and it compiled. when I ran it in wine there were other errors but that another thing. thanks for all your help.

On Tue, May 29, 2012 at 8:24 AM, Jamie Lahowetz <jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Thanks for the reply.
I changed LIBS to LIBS="$LIBS -lboost_thread_win32-mt"
And am now receiving the error:
terminal.o: In function `thread<int (SshClient::*)(int), SshClient*, int>':
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/include/boost/thread/detail/thread.hpp:259: undefined reference to `_imp___ZN5boost6thread12start_threadEv'
terminal.o: In function `ZN10MainWindow12get_stn_infoEv':
/home/deadpickle/hprcc_terminal/src/terminal.cpp:35: undefined reference to `_imp___ZN5boost6threadD1Ev'
I received this before and assumed that it was because I was linking incorrectly. How can we fix it?



On Tue, May 29, 2012 at 3:18 AM, Mark Brand <mabrand-Caog9qLlAxTz+pZb47iToQ@public.gmane.org> wrote:

       I'm trying to use the boost_thread libraries in my program and
       are having troubles linking to the library. Im using autotools
       to build my project and I keep getting the error
       /home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/bin/ld:
       cannot find -lboost_thread_win32-mt.a
       So far I have tried setting the LDFLAG in my configure call
       and specifying -llibboost_thread_win32-mt.a and none of these
       seem to be working. Any ideas?


   The flag "-lboost_thread_win32-mt" corresponds to the file
   "usr/i686-pc-mingw32/lib/libboost_thread_win32-mt.a". In other
   words, in your linker flag, omit the "lib" prefix and the ".a" suffix.


hope im understanding your reply correctly.
in configure.ac <http://configure.ac> i removed the -l and a.

LIBS="$LIBS libboost_thread_win32-mt"
then ran
./configure --prefix=/home/deadpickle/hprcc_terminal/win32 --host=i686-pc-mingw32 LDFLAGS='-L/home/deadpickle/mxe/usr/i686-pc-mingw32/lib/'
but still received the error
i686-pc-mingw32-g++: error: libboost_thread_win32-mt: No such file or directory

Don't omit the "-l" flag. Do omit the "lib" prefix and the ".a" suffix.

Mark




--
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Earth and Atmospheric Sciences
402.304.0766
jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org



--
Jamie Ryan Lahowetz
University of Nebraska - Lincoln
Graduate Student - Earth and Atmospheric Sciences
402.304.0766
jlahowetz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Mark Brand | 29 May 2012 16:36
Picon

Re: [Mingw-cross-env-list] linking to libboost_thread_win32-mt.a


Jamie Lahowetz wrote:
> Thanks for the reply.
> I changed LIBS to LIBS="$LIBS -lboost_thread_win32-mt"
> And am now receiving the error:
> terminal.o: In function `thread<int (SshClient::*)(int), SshClient*, 
> int>':
>
/home/deadpickle/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.0/../../../../i686-pc-mingw32/include/boost/thread/detail/thread.hpp:259: 
> undefined reference to `_imp___ZN5boost6thread12start_threadEv'
> terminal.o: In function `ZN10MainWindow12get_stn_infoEv':
> /home/deadpickle/hprcc_terminal/src/terminal.cpp:35: undefined 
> reference to `_imp___ZN5boost6threadD1Ev'
> I received this before and assumed that it was because I was linking 
> incorrectly. How can we fix it?
>

In src/boost.mk, where test-boost.exe is built, "-DBOOST_THREAD_USE_LIB" 
looks like the answer.

Mark


Gmane