|
Boost Users : |
From: Jason McGuidwin (jmcguidwin_at_[hidden])
Date: 2007-12-20 13:29:08
Edward ,
I think that is want i am doing below is my other posting that knowone has
replyed yet.
"VS2005 threads with clr option not working"
hello,
I am trying to compile a simple proragm with the thread headers included and
the clr option in VS2005
When i include the thread headers and set the to compile with the /clr
option the app will not execute and give the error below:
"The application failed to initialize properly (0xc000007b). Click on OK to
terminate the application."
this sample program works fine without the clr option, however I am writing
a managed c++ app that needs this option on.
also I have used the lib installer from
http://www.boost-consulting.com/products/free
the 1.34.1 installer for vs8.0, I have selected all options and still does
not work.
I have tried defining BOOST_THREAD_USE_DLL and BOOST_THREAD_USE_LIB, still
fails.
BOOST_THREAD_USE_LIB error message is the same as if I did not have this
define.
BOOST_THREAD_USE_DLL error message: "This application has failed to start
because boost_threads-vc80-mt-gd-1_34_1.dll was not found. Re-Installing the
application may fix this problem."
my project prefs have the following settings:
c/c++ - additional include directories= "C:\Program
Files\Boost\boost_1_34_1\"
linker - additional include directories= "C:\Program
Files\Boost\boost_1_34_1\lib"
[code]
#include "stdafx.h"
#include <iostream>
#include <boost/timer.hpp>
//#define BOOST_THREAD_USE_DLL
//#define BOOST_THREAD_USE_LIB
#include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp>
int main(int argc, char* argv[])
{
boost::xtime expiration;
boost::timer the_timer; //starts the timer
std::cout<<"Welcome to the sample program!"<<std::endl;
for(int i = 0;i <1000000; i++)
{
if(i%100000 == 0)
{
std::cout<<".";
boost::xtime_get(&expiration, boost::TIME_UTC);
expiration.nsec +=int(5 * 1e08);// half second;
boost::thread::sleep(expiration);
}
}
std::cout<<std::endl<<"This program has been running for: "<<
the_timer.elapsed() <<" second(s)." << std::endl;
std::cout<< std::endl<<"Press any key then enter to exit. "<< std::endl;
char buff[100];
std::cin>>buff;
}
[/code]
Jason McGuidwin
Gnostech Inc. San Diego, Ca
----- Original Message -----
From: "Edward Diener" <eldiener_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.user
To: <boost-users_at_[hidden]>
Sent: Wednesday, December 19, 2007 4:06 PM
Subject: Re: VS2005 with boost and /CLR
> Jason McGuidwin wrote:
>> I want to use the boost libraries with VS2005 and CLR option.
>>
>> how did you do this? how do you do this?
>>
>> I can get it to work without clr but I need to use managed and unmanaged
>> code.
>
> You create a mixed mode CLR module, using C++/CLI, where you can have
> both CLR constructs ( classes etc. ) and C++ standard constructs (
> classes etc. ). In your C++ standard classes you can use Boost just as
> you normally would in standard C++.
>
> In your CLR class methods you can instantiate objects of standard C++
> types, as well as your own types, and manipulate them. You can not,
> however, have an object of a standard C++ type as a member variable of a
> CLR class.
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