Boost logo

Boost Users :

Subject: Re: [Boost-users] simple thread program hardtocompile/link with 1.46.1
From: Eric Lin (kingdavid1_at_[hidden])
Date: 2011-05-22 20:09:02


Dear Steven or any boost programers/users:

I tried
./bootstrap.sh
./bjam
./bjam install

in my /boost_1_46_1/ directory which is auto extracted by my ubuntu linux after download

but I got the following build/compile errors:(these are just small portion of all errors)(c++ compiler is g++ of gnu on intel)
------------------------------
    cp "bin.v2/libs/math/build/gcc-4.4.3/release/link-static/threading-multi/libboost_math_c99f.a"  "/usr/local/lib/libboost_math_c99f.a"

...failed common.copy /usr/local/lib/libboost_math_c99f.a...
common.copy /usr/local/lib/libboost_math_c99l.a
cp: cannot create regular file `/usr/local/lib/libboost_math_c99l.a': Permission denied

    cp "bin.v2/libs/math/build/gcc-4.4.3/release/link-static/threading-multi/libboost_math_c99l.a"  "/usr/local/lib/libboost_math_c99l.a"

...failed common.copy /usr/local/lib/libboost_math_c99l.a...
common.copy /usr/local/lib/libboost_program_options.a
cp: cannot create regular file `/usr/local/lib/libboost_program_options.a': Permission denied

    cp "bin.v2/libs/program_options/build/gcc-4.4.3/release/link-static/threading-multi/libboost_program_options.a"  "/usr/local/lib/libboost_program_options.a"

...failed common.copy /usr/local/lib/libboost_program_options.a...
common.copy /usr/local/lib/libboost_python.a
cp: cannot create regular file `/usr/local/lib/libboost_python.a': Permission denied

    cp "bin.v2/libs/python/build/gcc-4.4.3/release/link-static/threading-multi/libboost_python.a"  "/usr/local/lib/libboost_python.a"

...failed common.copy /usr/local/lib/libboost_python.a...
common.copy /usr/local/lib/libboost_random.a
cp: cannot create regular file `/usr/local/lib/libboost_random.a': Permission denied

    cp "bin.v2/libs/random/build/gcc-4.4.3/release/link-static/threading-multi/libboost_random.a"  "/usr/local/lib/libboost_random.a"

...failed common.copy /usr/local/lib/libboost_random.a...
common.copy /usr/local/lib/libboost_serialization.a
cp: cannot create regular file `/usr/local/lib/libboost_serialization.a': Permission denied

    cp "bin.v2/libs/serialization/build/gcc-4.4.3/release/link-static/threading-multi/libboost_serialization.a"  "/usr/local/lib/libboost_serialization.a"

...failed common.copy /usr/local/lib/libboost_serialization.a...
common.copy /usr/local/lib/libboost_wserialization.a
cp: cannot create regular file `/usr/local/lib/libboost_wserialization.a': Permission denied

    cp "bin.v2/libs/serialization/build/gcc-4.4.3/release/link-static/threading-multi/libboost_wserialization.a"  "/usr/local/lib/libboost_wserialization.a"

...failed common.copy /usr/local/lib/libboost_wserialization.a...
common.copy /usr/local/lib/libboost_signals.a
cp: cannot create regular file `/usr/local/lib/libboost_signals.a': Permission denied

    cp "bin.v2/libs/signals/build/gcc-4.4.3/release/link-static/threading-multi/libboost_signals.a"  "/usr/local/lib/libboost_signals.a"

...failed common.copy /usr/local/lib/libboost_signals.a...
common.copy /usr/local/lib/libboost_prg_exec_monitor.a
cp: cannot create regular file `/usr/local/lib/libboost_prg_exec_monitor.a': Permission denied

    cp "bin.v2/libs/test/build/gcc-4.4.3/release/link-static/threading-multi/libboost_prg_exec_monitor.a"  "/usr/local/lib/libboost_prg_exec_monitor.a"

...failed common.copy /usr/local/lib/libboost_prg_exec_monitor.a...
common.copy /usr/local/lib/libboost_unit_test_framework.a
cp: cannot create regular file `/usr/local/lib/libboost_unit_test_framework.a': Permission denied

    cp "bin.v2/libs/test/build/gcc-4.4.3/release/link-static/threading-multi/libboost_unit_test_framework.a"  "/usr/local/lib/libboost_unit_test_framework.a"

...failed common.copy /usr/local/lib/libboost_unit_test_framework.a...
common.copy /usr/local/lib/libboost_thread.a
cp: cannot create regular file `/usr/local/lib/libboost_thread.a': Permission denied

    cp "bin.v2/libs/thread/build/gcc-4.4.3/release/link-static/threading-multi/libboost_thread.a"  "/usr/local/lib/libboost_thread.a"

...failed common.copy /usr/local/lib/libboost_thread.a...
common.copy /usr/local/lib/libboost_wave.a
cp: cannot create regular file `/usr/local/lib/libboost_wave.a': Permission denied

    cp "bin.v2/libs/wave/build/gcc-4.4.3/release/link-static/threading-multi/libboost_wave.a"  "/usr/local/lib/libboost_wave.a"

...failed common.copy /usr/local/lib/libboost_wave.a...
...failed updating 46 targets...
...skipped 8335 targets...
eric_at_eric-laptop:~/boost1/boost_1_46_1$
-----------------------------------------
looking to see any boost programers or users's help, thanks a lot in advnace, Eric

----------------------------------------
Date: Sun, 22 May 2011 08:05:02 -0700
From: watanabesj_at_[hidden]
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] simple thread program hardtocompile/link with 1.46.1

AMDG

On 05/21/2011 11:23 PM, Eric Lin wrote:
> Dear boost program(for c++,(or g++)):
> after I download 1.46.1 and try to base on it to compile a simple
> program from book C++cookbook, at page 447, 12.1 Creating a Thread

You need to build the thread library. See
http://www.boost.org/more/getting_started/unix-variants.html
If you've already compiled the library, try -lboost_thread.
If you didn't install the libraries to a system
location, then you'll also need -L/path/to/compiled/libraries

> ----------
>
> // example 12-1. Creating a thread
> #include
> #include
> #include
>
> struct MyThreadFunc {
> void operator()() {
> // Do something long-running...
> }
> } threadFun;
>
> int main() {
> boost::thread myThread(threadFun); // Create a thread that starts
> // running threadFun
> boost::thread::yield(); // give up the main thread's timeslice
> // so the child thread can get some work
> // done.
>
> // Go do some other work...
>
> myThread.join(); // The current (i.e., main) thread will wait
> // for myThread to finish before it returns
> }
>
> -----------------------------------------------------------
>
> eric_at_eric-laptop:~/cppcookbook$ ls
> example12-1.cpp
> eric_at_eric-laptop:~/cppcookbook$ g++ -I/home/eric/boost1/boost_1_46_1/ example12-1.cpp -lboost_thread-mt
> /usr/bin/ld: cannot find -lboost_thread-mt
> collect2: ld returned 1 exit status
> eric_at_eric-laptop:~/cppcookbook$ g++ -I/home/eric/boost1/boost_1_46_1/ example12-1.cpp -lboost
> /usr/bin/ld: cannot find -lboost
> collect2: ld returned 1 exit status
> eric_at_eric-laptop:~/cppcookbook$ cd ../boost1/boost_1_46_1/
> eric_at_eric-laptop:~/boost1/boost_1_46_1$
>
> --------------------------
>
> I am in Ubuntu linux 10.04, g++ 4.4.3
>
> looking to see any suggestion and thanks a lot in advance, Eric Lin, Us citizen, in Los Angeles
> I am glad to meet anyone in Los Angeles on computer science meeting
>

In Christ,
Steven Watanabe

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
                                               


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net