简体   繁体   English

我可以在没有Visual Studio的情况下编译DLL吗?

[英]Can I compile DLLs without Visual Studio?

My intention is to take a C++ library , wrap it for C# with SWIG ( alt. link ), and compile both C++ and C# components as DLLs for Unity 5. (The C# DLL provides Unity with an interface to the C++ DLL.) 我的意图是采用一个C ++库 ,将其与SWIG替代链接 )包装在一起用于C#,并将C ++和C#组件都编译为DLL for Unity5。(C#DLL为Unity提供了C ++ DLL的接口。)

To the best of my knowledge, compiling C++ and C# DLLs always requires Visual Studio (or tools like msbuild that come with VS). 据我所知,编译C ++和C#DLL始终需要Visual Studio(或VS附带的msbuild工具)。 However, I am currently struggling to get VS installed, which has led me to question that assumption. 但是,我目前正在努力安装VS,这使我对这一假设提出了质疑。

Are there any other options for compiling Unity-ready DLLs on Windows? 还有其他用于在Windows上编译Unity就绪DLL的选项吗?

(Even if I get VS installed, I'm still curious to know.) (即使我安装了VS,我还是很想知道。)

You can download a stand alone version of MSBuild and use that to compile you code, you don't need VS for that. 您可以下载MSBuild的独立版本,并使用该版本编译代码,而无需VS。

There's a walkthrough here : 有一个演练在这里

msbuild buildapp.csproj /t:HelloWorld

Use command line tools like csc (C# Compler) , they have everything to do the job, you do not need anything else, check this out the Link . 使用csc (C# Compler)类的命令行工具,它们可以完成所有工作,而您不需要其他任何东西,请查看Link

You just need to install .Net framework to get the compiler no VS or any other tool required. 您只需要安装.Net框架即可使编译器不需要VS或任何其他工具。 It has switch for every option provided by VS. 它具有VS提供的每个选项的开关。

In case you need assembly linking use the Assembly Linker tool Link . 如果您需要装配链接,请使用Assembly Linker工具Link

Check the following Link on ILMerge too 也在ILMerge上检查以下链接

Yes, you can use MinGW to compile C++ to a DLL from the commandline. 是的,您可以使用MinGW从命令行将C ++编译为DLL

If you prefer a GUI interface, you might try Code::Blocks . 如果您更喜欢GUI界面,则可以尝试Code :: Blocks It comes bundled with a tweaked version of MinGW, but since it's a GUI-based IDE you don't have to interact with it directly :) 它与经过调整的MinGW版本捆绑在一起,但是由于它是基于GUI的IDE,因此您无需直接与其进行交互:)

However, you'll still need to get your swig-wrapped code into a C# DLL. 但是,您仍然需要将经过缠绕包装的代码放入C#DLL中。 I'd investigate whether MonoDevelop can achieve this. 我将研究MonoDevelop是否可以实现这一目标。

EDIT: Just seen ReCoF's answer - it seems you can use MonoDevelop for the C# side of things so you're good to go :) 编辑:刚刚看到ReCoF的答案-看来您可以将MonoDevelop用于事物的C#方面,因此您很好:)

You can also compile your project with MonoDevelop. 您也可以使用MonoDevelop编译项目。 You just have to choose the Release Mode instead of the Debug one. 您只需要选择发布模式而不是调试模式即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在没有Visual Studio的系统上编译.NET 3.5 C#代码? - How can I compile .NET 3.5 C# code on a system without Visual Studio? 如何在不涉及Visual Studio的情况下编译C#解决方案? - How can I compile a C# solution without involving Visual Studio? 如何在没有默认 DLL 文件的情况下编译 C# Visual Studio 项目? - How can I compile a C# visual studio project without the default DLL file? 我可以在Visual Studio 2008中从C#项目构建2个或更多dll吗? - Can I build 2 or more dlls from C# project in Visual Studio 2008? 构建Visual Studio项目而无需访问引用的dll - Build a Visual Studio Project without access to referenced dlls 我可以在没有Visual Studio的情况下创建ClickOnce吗? - Can I create ClickOnce without Visual Studio? MsBuild在我生成时会删除依赖项dll,然后在Visual Studio中进行调试 - MsBuild deletes dependency dlls when I build, then debug in Visual Studio 编译-在没有Visual Studio的情况下获取XAP文件 - Compile - get XAP file without Visual Studio 在Visual Studio代码中引用DLL - Referencing DLLs in Visual Studio Code 如何在Visual Studio IDE中从github查看源代码,但如何使用Nuget的dll进行编译? - How to see source code from github in Visual Studio IDE, but compile with dlls from Nuget?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM