Home » Community » Newbie corner » U++ and Managed c++ /clr
Re: U++ and Managed c++ /clr [message #34244 is a reply to message #34243] |
Sun, 06 November 2011 07:15 |
Sender Ghost
Messages: 301 Registered: November 2008
|
Senior Member |
|
|
Let's create simple "Core console project" application:
#include <Core/Core.h>
using namespace Upp;
#using <mscorlib.dll>
using namespace System;
CONSOLE_APP_MAIN
{
Cout() << "Hello, from U++!\n";
Console::WriteLine("Hello, from managed C++!");
}
Open "Project -> Package organizer.." for main package and insert following compiler option:
-clr
Open "Project -> Main package configuration.." menu and add following build flags:
EVC .USEMALLOC
EVC - is build flag (used for another C++ compiler), which adds compiler options to turn off exception handling, because -clr is not compatible with -EHsc compiler option.
USEMALLOC - disables U++ memory allocator to not conflict with .NET Framework memory allocation methods.
Also check "Build -> Output mode.." menu for the "Use shared libs" link mode.
Now, you can build combined U++ and Managed C++ package.
To note:
It also possible to extend C++ syntax higlighting for managed C++ extensions and add CLR specific compiler options, instead of EVC.
Here, I just showed possible way to use TheIDE with Managed C++ extensions. I don't think, this is recommended way.
[Updated on: Sun, 20 November 2011 21:08] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 22:05:44 CEST 2024
Total time taken to generate the page: 0.02289 seconds
|