LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-23-2008, 05:29 AM   #1
kolikko
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Build DLL in Linux and use it on Windows


Hi all,

Does anyone know if it is possible to build DLL on Linux platform and then use it on Windows side?

Source code would be written in C++.

Thanks.
 
Old 10-23-2008, 05:36 AM   #2
abolishtheun
Member
 
Registered: Mar 2008
Posts: 183

Rep: Reputation: 31
For a native DLL/shared objects, you don't. Windows cannot run linux binaries (duh). You'd rebuild on windows.

For .NET, though, mono DLL's should technically run unmodified on windows.
 
Old 10-23-2008, 06:27 AM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by abolishtheun View Post
For a native DLL/shared objects, you don't. Windows cannot run linux binaries (duh). You'd rebuild on windows.
Your answer is incorrect. Building dlls on linux has nothing to do with linux binaries.

Quote:
Originally Posted by kolikko View Post
Hi all,

Does anyone know if it is possible to build DLL on Linux platform and then use it on Windows side?

Source code would be written in C++.

Thanks.
Yes, it is possible, but sometimes it's tricky (and in some rare situations it's very difficult to make tools work). I did windows programming on linux machine.
You can use:
1) mingw-cross .
2) Wine + Microsoft Visual Studio compiler toolkit 2003. (Good luck finding this one. It's still on the web, but not on Microsoft Website).
3) Wine + mingw.

In my opinion, Using wine+windows compiler is easiest way.

All those utilities can be used in conjuction with scons or gnu make.
Search for mingw-cross, this should be enough to get started. Also expect that your program might not work through wine at all, and be ready to get unexpected problems during compilation (for example, running windows version mingw with mingw will may require native windows msvcrt.dll, due to the wine bug (which could be already fixed by now)).
 
Old 10-23-2008, 07:41 AM   #4
kolikko
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ErV View Post
Yes, it is possible, but sometimes it's tricky (and in some rare situations it's very difficult to make tools work). I did windows programming on linux machine.
You can use:
1) mingw-cross .
2) Wine + Microsoft Visual Studio compiler toolkit 2003. (Good luck finding this one. It's still on the web, but not on Microsoft Website).
3) Wine + mingw.

In my opinion, Using wine+windows compiler is easiest way.
Thanks for those, I will check that mingw-cross.

Quote:
Originally Posted by ErV View Post
All those utilities can be used in conjuction with scons or gnu make.
Search for mingw-cross, this should be enough to get started. Also expect that your program might not work through wine at all, and be ready to get unexpected problems during compilation (for example, running windows version mingw with mingw will may require native windows msvcrt.dll, due to the wine bug (which could be already fixed by now)).
I don't want to run our program through wine or at Linux at all. I just want to be able to compile DLL files using Linux, real software which uses those DLL's is compiled on Windows and will also run on real Windows platform.

Do you think that's possible? And is mingw needed on Windows side then if I want to use those DLL's?
 
Old 10-23-2008, 01:57 PM   #5
abolishtheun
Member
 
Registered: Mar 2008
Posts: 183

Rep: Reputation: 31
Quote:
Originally Posted by ErV View Post
Your answer is incorrect. Building dlls on linux has nothing to do with linux binaries.
DLL's/shared objects are executable binaries.
 
Old 10-23-2008, 02:41 PM   #6
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
DLL's/shared objects are executable binaries.
True but the OP wants to build on Linux and deploy on Windows - this process is known as cross compilation and is perfectly feasible.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
porting a windows dll into linux so file bianchi Programming 1 12-20-2005 02:58 PM
How to build a DLL in Windows XP? hoper Programming 2 12-28-2004 08:29 AM
How to build a DLL in Windows XP? hoper General 1 12-28-2004 06:55 AM
Windows DLL to Linux .so mohan_mohan Linux - Software 3 11-04-2004 10:43 AM
Can I access a Windows DLL directly from Linux code? Silverjam Linux - Software 3 07-10-2004 09:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration