Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 21994

Is it possible to compile C++ that's using a .NET DLL with GCC?

$
0
0

I want to use the AML.Engine.dll (https://github.com/AutomationML/AMLEngine2.1) in a C++ project. I have gotten it to work with the Microsoft C++ Compiler, but also need it to work with GCC but couldn't do so yet. Are there any compiler settings necessary to do so? Or is it just not possible with GCC?

The code below shows a simple demo project that I tried to get to work.

#include <iostream>
#include <string>
#include <stdlib.h> 
using namespace std;
#using <AML.Engine.dll>
#using <System.dll>
#using <System.Xml.dll>
#using <System.Xml.Linq.dll>
using namespace Aml::Engine::CAEX;

int main()
{
    // create a new empty document
    auto caexDocument = CAEXDocument::LoadFromFile("BSM_Project_210219_V3.1.aml");
    CAEXDocument^ doc = CAEXDocument::New_CAEXDocument();

    for each(auto instanceHierachy in caexDocument->CAEXFile->InstanceHierarchy){
        for each(auto element in instanceHierachy->InternalElement){
            System::Console::WriteLine( element->Name) ;
            System::Console::WriteLine( "----------------------------------------------------------") ;
            for each(auto ielement in element->InternalElement){  
                System::Console::WriteLine( ielement->Name) ;
            }

        }  

    }
}

Viewing all articles
Browse latest Browse all 21994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>