Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core Libraries on Linux and MAC #38100

Closed
jnkarate opened this issue Jun 11, 2020 · 9 comments
Closed

.NET Core Libraries on Linux and MAC #38100

jnkarate opened this issue Jun 11, 2020 · 9 comments
Labels
area-Host question Answer questions and provide assistance, not an issue with source code or documentation. untriaged New issue has not been triaged by the area owner

Comments

@jnkarate
Copy link

Is there a way to call .NET Core libraries from native C++ on MAC and Linux? I know there is the C++/CLI on windows that allows you to do this, is there a way to do this on MAC and Linux?

@scalablecory
Copy link
Contributor

@jeffschwMSFT

@jeffschwMSFT
Copy link
Member

You can use the .NET Core hosting layer which is available on all our supported platforms. Here is the documentation https://docs.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting and some samples https://github.com/dotnet/samples/tree/master/core/hosting.

@jnkarate
Copy link
Author

Thank you!

@jnkarate jnkarate reopened this Jun 18, 2020
@jnkarate
Copy link
Author

jnkarate commented Jun 18, 2020

So as I am writing a host is there a way to call non-static methods, such as constructors in the host, as so far I only have gotten static methods to work. I am using coreclr.h. Also this is on linux.

@jeffschwMSFT jeffschwMSFT transferred this issue from dotnet/core Jun 18, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Jun 18, 2020
@ghost
Copy link

ghost commented Jun 18, 2020

Tagging subscribers to this area: @vitek-karas, @swaroop-sridhar
Notify danmosemsft if you want to be subscribed.

@jeffschwMSFT jeffschwMSFT added the question Answer questions and provide assistance, not an issue with source code or documentation. label Jun 18, 2020
@jeffschwMSFT
Copy link
Member

@jnkarate the way that we recommend to do this is to call a static method which then does the more complex object construction. In this case the static method could create an object (via the constructor of your choice) and return back function pointers, etc.
Do you have an example that we can take a look at so that we can provide some additional thoughts?

cc @AaronRobinsonMSFT @vitek-karas

@AaronRobinsonMSFT
Copy link
Member

@jnkarate A similar question was asked and an example provided at dotnet/docs#18174 (comment).

@jnkarate
Copy link
Author

Thank you for the help I really appreciate it.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host question Answer questions and provide assistance, not an issue with source code or documentation. untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

5 participants