如何在 Ubuntu 中将 c++ 编译为 Windows 的 .net Dll 文件

How to compile c++ to Window's .net Dll file in Ubuntu

本文关键字:Windows net Dll 文件 编译 Ubuntu 中将 c++      更新时间:2023-10-16

现在我可以使用提供的make文件成功编译,现在我想将项目编译为dll文件,我应该如何修改make文件,以便我可以在windows .net框架中使用dll文件?我想要的是一个。net dll(不只是一个win32 dll)。

make文件为:

default: all
# -------------------------------------------------------------------
# Change the path to Z3 4.1.1 accordingly
# The directory indicated by this path should contain "lib" and "bin"
# e.g. "/home/z3_src_4.1.1"
#      "/home/work/tool/z3/z3_src_4.1.1"
# -------------------------------------------------------------------
Z3_path = ../z3
JUNK = S3
SOURCE = strTheory.cpp testMain.cpp
INCLUDE = $(Z3_path)/lib
LIB = $(Z3_path)/bin/external
all: $(SOURCE)
    g++ -std=c++14 -O3 -fopenmp -static -I$(INCLUDE) -L$(LIB) $(SOURCE) -lz3 -lrt -o S3 -Wall
    @echo ""
clean:
    rm -f $(JUNK)

在google中搜索" linux上的交叉编译器"。这个问题已经问过好几次了

在Linux中创建一个库或DLL并在Windows上使用

如何用gcc/g++在Linux上编译Windows ?