Boost logo

Boost Users :

From: imi123_1999 (imi123_1999_at_[hidden])
Date: 2002-05-17 02:38:48


This is my second post. In the last post i pointed out two errors out
of which one is fixed but the other one is still there.

I am trying to build a sample program on threads in VC++. It compiles
successfully but the linker gives errors of unresolved external
symbols. Please tell me that what "changes" we've to make in VC++ 6
linker options. Please tell me clearly that in which dialog box of
VC++ IDE we have to make changes and how and what changes we've to
made. I am using boost 1_27_0. Program and errors are given below:

********************************************************

The program is:

#include <boost/thread/thread.hpp>
#include <iostream>

int count = 0;
boost::mutex mutex;

void increment_count()
{
   boost::mutex::scoped_lock lock(mutex);
   std::cout << "count = " << ++count << std::endl;
}

int main(int argc, char* argv[])
{
   boost::thread_group threads;
   for (int i = 0; i < 10; ++i)
      threads.create_thread(&increment_count);
   threads.join_all();
}

********************************************************
The errors i am getting are:

imi.obj : error LNK2001: unresolved external symbol "public:
__thiscall boost::mutex::mutex(void)" (??0mutex_at_boost@@QAE_at_XZ)

imi.obj : error LNK2001: unresolved external symbol "public:
__thiscall boost::mutex::~mutex(void)" (??1mutex_at_boost@@QAE_at_XZ)

imi.obj : error LNK2001: unresolved external symbol "public:
__thiscall boost::thread_group::~thread_group(void)" (??
1thread_group_at_boost@@QAE_at_XZ)

imi.obj : error LNK2001: unresolved external symbol "public: void
__thiscall boost::thread_group::join_all(void)" (?
join_all_at_thread_group_at_boost@@QAEXXZ)

imi.obj : error LNK2001: unresolved external symbol "public: class
boost::thread * __thiscall boost::thread_group::create_thread(class
boost::function0<void,struct boost::empty_function_policy,struct
boost::empty_function_mixin,int> const &)" (?crea
te_thread_at_thread_group_at_boost@@QAEPAVthread_at_2@ABV?
$function0_at_XUempty_function_policy_at_boost@@Uempty_function_mixin_at_2@H_at_2@
@Z)

imi.obj : error LNK2001: unresolved external symbol "public:
__thiscall boost::thread_group::thread_group(void)" (??
0thread_group_at_boost@@QAE_at_XZ)

imi.obj : error LNK2001: unresolved external symbol "public:
__thiscall boost::lock_error::lock_error(void)" (??
0lock_error_at_boost@@QAE_at_XZ)

imi.obj : error LNK2001: unresolved external symbol "private: void
__thiscall boost::mutex::do_lock(void)" (?do_lock_at_mutex@boost@@AAEXXZ)

imi.obj : error LNK2001: unresolved external symbol "private: void
__thiscall boost::mutex::do_unlock(void)" (?
do_unlock_at_mutex@boost@@AAEXXZ)

Debug/threadImI.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.

threadImI.exe - 10 error(s), 0 warning(s)


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