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.
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.
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
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.
Jason McGuidwin wrote:
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
Your program looks like a console application because of the 'main' function. Why are you attempting to create a console application using CLR ? Given that you are doing so, did you use the IDE to create a project and specify CLR console application as the project type ? If not that should be your first step.
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."
I have not used the thread library in a C++/CLI mixed mode project, although I have used other Boost libraries, including regex++, which has DLLs which have to be built. But I have always setup my project from the IDE, as it invariably creates the basic settings correctly. I wouldn't touch command line building unless I converted the IDE setup to a command line system ( lookup MSBuild in order to do so ). In the CLR console application in the IDE, the default is that it links with the multi-threaded RTL DLL. You need to make sure that when you use Boost thread you are also linking to the version built with the multi-threaded RTL. Also always keep release annd debug build in synch with Boost versions that also link to the correct RTL as there are release and debug version of the VC RTLs and they should never be mixed.
Jason McGuidwin wrote:
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."
I'm not completely sure, but I believe there is a fundamental incompatibity between Boost.Threads and the CLR, but Anthony Williams would know for sure I guess? John.
"John Maddock"
Jason McGuidwin wrote:
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."
I'm not completely sure, but I believe there is a fundamental incompatibity between Boost.Threads and the CLR, but Anthony Williams would know for sure I guess?
Boost.Thread has not been written with compatibility with /CLR in mind, and has not been tested under that configuration (at least, not by me, and not by the regression tests) so it is possible that there is a fundamental incompatibility. Peter pointed out the TLS hooks issue with static libraries --- it's possible that's the cause of the problem. Since boost.thread is by its nature a system-level library, I would compile it as native code in a DLL rather than use it directly from a CLR app. Anthony -- Anthony Williams Just Software Solutions Ltd - http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
participants (4)
-
Anthony Williams
-
Edward Diener
-
Jason McGuidwin
-
John Maddock