How to create Linux .so file under Windows

17 ビュー (過去 30 日間)
David
David 2015 年 11 月 9 日
コメント済み: Walter Roberson 2015 年 11 月 9 日
Hi dear community,
I have a question for generating a Linux .so file under Windows. I have successfully created a 64-bit .dll of my code under Windows. Now I would like to use this code also within Linux.
My question: Is it possible to compile the code which exists in Windows to a according .so file, so that I can use it within Linux?
Thank you in advance, David

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 11 月 9 日
Yes, if you go to enough trouble. See for example http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/
But only if "the code which exists on Windows" refers to the source code. Compiling the .dll to a .so is possibly not implemented by anyone. (People who want to do that usually instead install Windows as a virtual machine on Linux, or use Wine or the equivalent.)
  2 件のコメント
Guillaume
Guillaume 2015 年 11 月 9 日
It seems to me that the OP is asking the opposite: Compile for Linux on Windows.
I would probably go the same route though. Install a Linux VM under windows.
Walter Roberson
Walter Roberson 2015 年 11 月 9 日
Darn, didn't notice google flipped my query around from what I want. Anyhow, see http://stackoverflow.com/questions/4769968/c-cross-compiler-from-windows-to-linux

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by