Is there a sample MAUI application to call c++ libarary

Yang Yang 46 Reputation points
2022-06-13T02:36:40.78+00:00

I have a cross-platform library written with C++, I use this library to create model and display it with OpenGL. Now I'd like to choose MAUI to create a desktop application and call above library to complete interactions. Now I need a sample for reference on how to collabrate with c++ library/codes in MAUI application.

Developer technologies | .NET | .NET MAUI
Developer technologies | C++
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
{count} vote

Answer accepted by question author
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,451 Reputation points Microsoft External Staff
    2022-06-15T08:24:41.6+00:00

    Hi @Yang Yang ,

    We can use P/Invoke to consume a native library, you could try to check this doc - Use C/C++ libraries with Xamarin, then try to adjust to implement a version of MAUI. Please feel free to let me know if you have any other issues.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    3 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.