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.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,650 questions
C++
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.
3,774 questions
{count} vote

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 32,781 Reputation points Microsoft Vendor
    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 Answers by the question author, which helps users to know the answer solved the author's problem.