Skip to content

XinLei-L/call_dll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C++调用C#生成的动态链接库dll
linux系统上搭建C#运行环境
src文件
  • example.cs

    C#代码:主要实现两个接口

    接口HelloWorld:输出Hello from C#!

    接口Add:整型相加

  • MyLibrary.dll

    mcs -target:library -out:MyLibrary.dll example.cs 
  • test.cpp

    调用MyLibrary.dll库的Add接口,实现两个整数相加

    对test.cpp进行编译,生成执行文件my_cpp_program

    g++ -o my_cpp_program test.cpp -I /usr/include/mono-2.0 -lmono-2.0

About

C++calls DLL of C #

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published