LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-09-2009, 09:56 PM   #1
Bram van Kampen
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
MFC and Linux


I am Sick of developing for MS Windows.
Our development cycle is quite slow, The Nice market we cater for does not require cutting edge solutions.
The software we have developed runs comfortably on WIN95/98 as well as XP. Vista managed to break it, and offered NO benefits to compensate!
I am now looking for an alternative Platform. I would like to continue to develop in Visual Studio and MFC. Question: Will the code so developed run under Linux without Mods.

Regards,

Bram
 
Old 11-09-2009, 11:39 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Microsoft Visual Studio doens't support Linux.
 
Old 11-10-2009, 12:39 AM   #3
chiragrk
Member
 
Registered: Nov 2009
Location: India
Distribution: Xandros, Ubuntu
Posts: 74

Rep: Reputation: 16
You may want to check the mono project http://www.mono-project.com/Main_Page. AFAIK, Novell/SuSE has been active off late to get such inter-operability working.
 
Old 11-11-2009, 02:25 PM   #4
Bram van Kampen
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by raskin View Post
Microsoft Visual Studio doens't support Linux.
I did not mean to ask if MSDev Studio runs on Linux.
The question was realy, will the exe and dll's it produces run on Linux. The Windows and Linux Kernel Functions appear to have identical names, and I can distribute the MFC Dll's with my executables, as part of the Customers Setup. If Linux recognizes Standard Windows Binaries it should work, Only, I've never tried it.

Thanks,


Bram.

Last edited by Bram van Kampen; 11-11-2009 at 02:31 PM.
 
Old 11-11-2009, 02:28 PM   #5
Bram van Kampen
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by chiragrk View Post
You may want to check the mono project http://www.mono-project.com/Main_Page. AFAIK, Novell/SuSE has been active off late to get such inter-operability working.
Seen that, this however seems to relate to C# and Managed Code, which is an entirely different kettle of fish.


Thanks,

Bram.
 
Old 11-11-2009, 02:40 PM   #6
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
1. Mainline Linux kernel doesn't support Windows executable format on its own.
2. Linux kernel calls in many cases have different names, different call addresses and - more importantly - different semantics. For example, in Linux you can spilt a process in two, you may replace it with another one. These two are not always used together. In windows there seems to be no method to reproduce either semantics. Well, ExecuteProcess + Exit seems to be close to Linux execve, but still not quite.
3. Usually Windows-targeted binaries are run by Wine - a compatibility layer trying to load most Windows executables and libraries. It is installed on many computers. It may be or not be activated by attempt to launch an PE-format executable. It sometimes fails, although you as developer can produce executables that run on Wine. Actually, some of the developers do test with Wine as a first step at cleaning up problems for cross-platform development - and to encourage Linux users to try it.
4. You can use WineLib to quickly build Windows-targeted source in Linux. It is likely to require some modifications, but not too much. You will need to do the final part of development in Linux, though.
5. There is some project called LUK - Linux Unified Kernel that aims at native support for Windows executables in Linux.. Opinions vary. You wouldn't want to rely on the fact that someone uses it.
 
Old 11-11-2009, 05:26 PM   #7
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by Bram van Kampen View Post
I am Sick of developing for MS Windows.
Our development cycle is quite slow, The Nice market we cater for does not require cutting edge solutions.
The software we have developed runs comfortably on WIN95/98 as well as XP. Vista managed to break it, and offered NO benefits to compensate!
I am now looking for an alternative Platform. I would like to continue to develop in Visual Studio and MFC. Question: Will the code so developed run under Linux without Mods.

Regards,

Bram
Unfortunately there's no easy answer to your question. I've done a lot of MFC development with Visual Studio 6.0. MFC has a lot of features from dialog handling to database and OLE support.

Some programs using MFC will work with WINE on Linux. You are likely to have problems with databases, Active-X and OLE since they depend heavily on Component Object Model (COM) and Microsoft database technologies like DAO (Data Access Objects) and ADO (Active Data Objects). The database issue is what cause me the most trouble with Vista and I am currently working on replacing it with SQLITE 3.

You might want to look at some cross-platform development tools such as QT that are designed to create applications running on Windows and Linux.

Programs that use the dialog and window classes of MFC should work with WINE since it implements the Windows message processing and GUI functions quite closely. You may get other parts of MFC to work by using other required Microsoft DLL files. Anything that uses kernel functions or COM is less likely to work. Direct-X and 3D acceleration are also a problem.

So far the best way I've found to run MFC applications is using Windows XP in a virtual machine. VirtualBox works quite well for me and I use it on Windows and Linux to run my development environment of Windows XP and Visual Studio 6.

Microsoft has redefined their development environment starting with Vista and .NET. I don't think there's any way around that. To support Vista and newer versions of Windows will require rewriting applications. It's really a question of whether to use Microsoft development tools or something else that is compatible with Windows and other operating systems like Linux.
 
Old 11-12-2009, 08:46 PM   #8
Bram van Kampen
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Erik_FL View Post
Unfortunately there's no easy answer to your question. I've done a lot of MFC development with Visual Studio 6.0. MFC has a lot of features from dialog handling to database and OLE support.

Some programs using MFC will work with WINE on Linux. You are likely to have problems with databases, Active-X and OLE since they depend heavily on Component Object Model (COM) and Microsoft database technologies like DAO (Data Access Objects) and ADO (Active Data Objects). The database issue is what cause me the most trouble with Vista and I am currently working on replacing it with SQLITE 3.

You might want to look at some cross-platform development tools such as QT that are designed to create applications running on Windows and Linux.

Programs that use the dialog and window classes of MFC should work with WINE since it implements the Windows message processing and GUI functions quite closely. You may get other parts of MFC to work by using other required Microsoft DLL files. Anything that uses kernel functions or COM is less likely to work. Direct-X and 3D acceleration are also a problem.

So far the best way I've found to run MFC applications is using Windows XP in a virtual machine. VirtualBox works quite well for me and I use it on Windows and Linux to run my development environment of Windows XP and Visual Studio 6.

Microsoft has redefined their development environment starting with Vista and .NET. I don't think there's any way around that. To support Vista and newer versions of Windows will require rewriting applications. It's really a question of whether to use Microsoft development tools or something else that is compatible with Windows and other operating systems like Linux.
Sorry, I' used to 'Code Project' Interface, and it is not clear to me how the mechanics of the site works. Have not foud a way to reply without quoting your entitre post. (Sorry, but I will learn!)

1.
None of our app suite uses ideas like OLE, COM, or DAO. The whole App Suite DB Access is based on a File Sharing Method, MFC is only used as a Basic Dialog based User interface. The Database element is entirely prorietory. The only issue would be the access to Disk OEM info, such as the OEM Serial Number.

2.
I've since learned about 'WINE' This seems to be stuck however, in a 386 processor environment. How does it work with say DevStudio 5.00 and MFC42.

Thanks,

Bram.
 
Old 11-12-2009, 09:20 PM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
In my humble opinion, if you are continuing to develop windows-only software, you will be wasting your time if you change to linux. Linux is not windows, the linux kernel has nothing to do with the windows one, and it has exactly zero support for windows binaries (and that's just the binary format, not to speak about apis). Most of what can be said has already been said above by others so I will not re-state what's been already said.

To me, changing to linux when you are using windows-only software is like buying a playstation if you plan on buying only xbox games. It makes no sense, it doesn't really matter how good or nice the playstation OS is. If the problem is that windows updates will break your software, you are likely to encounter the same kind of regressions in wine as it advances (plus the problems that are intrinsic to wine, because as close as it gets, it's not Windows). The only advantage, for what it is worth, is that you can run wine to emulate concrete windows versions.

If you don't want to develop the same again and again and again with each windows release and want to continue using the same binaries forever, your best bets are either of these:
  • don't update these dedicated machines
  • update them, then install virtualbox or vmware and run an old windows version and your program inside an vm

Of course you are welcome to try linux if you truly want, regardless of my opinion on that idea.

Last edited by i92guboj; 11-12-2009 at 09:26 PM.
 
Old 11-13-2009, 11:34 AM   #10
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
What I suggest is that you look at this site.

CodeWeavers - Your Home for Windows Compatibility on Mac and Linux

There is an entire section on application compatibility and it will give you an idea of the compatibility that can be provided by WINE and the CodeWeavers add-on CrossOver software.

Visual Studio 6 is only partially compatible with Linux using CrossOver and WINE. Windows is still the best platform to develop Windows applications.

If you are willing to make application changes you can write applications that are compatible with Windows and Linux / WINE or Linux / CrossOver. The chances are not good for a Windows application to just install and run on Linux without any effort. In some cases the problem is installing all the needed fonts and DLL files. In other cases some changes to the program are required.

I'm not sure that I understand what you mean about WINE still being based on the 386 CPU. WINE provides some of the Windows APIs and those are not tied to any particular Intel X86 architecture. You can install DLLs such as MFC42 to provide additional APIs but the installation under WINE may not be as automatic. WINE does not attempt to provide functions of the Windows kernel or device drivers. Part of the problem in trying to support Windows applications is the multitude of different APIs that Microsoft has added over time. The WIN32 API provides limited file and system functions and most Windows applications use additional APIs such as the Windows NT Kernel that aren't supported by WINE.

WINE is not designed to be a replacement for a Windows OS. At best it is intended to allow some functions of some Windows applications to be used on Linux. WINE is also not designed to be a development platform to write new applications to run on Windows or Linux. Because of that it isn't a good choice for cross-platform development even if it can be used for that.
 
Old 11-14-2009, 08:44 PM   #11
vansch76
Member
 
Registered: Aug 2007
Location: Asheville, NC, USA
Distribution: Mint 17 Rebecca
Posts: 145

Rep: Reputation: 18
Hi Bram

you should also look at RealBasic. it claims to be a cross platform software that will allow
you to write for windows, mac and Linux. I haven't used it, but it looks interesting.

http://www.realsoftware.com/realbasic/

Vanessa
 
Old 11-15-2009, 08:59 AM   #12
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Well, if you want easy cross-platform development with free tools and you are ready to pick up any sane language, choose Pascal over Basic and use Lazarus.
 
  


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
Linux compatibility of Brother MFC Printers markw10 Linux - Hardware 6 08-30-2012 03:04 AM
Compiling/Converting MFC to Linux PhaseSpace Linux - Software 4 02-02-2005 01:02 PM
Porting from VC++: MFC Support on Linux sheenak Programming 2 01-13-2005 05:14 AM
MFC and GTKMM janiv Linux - Software 0 09-11-2003 05:57 AM
Does my Brother MFC-5100c work under linux? mikeylikesit! Linux - Hardware 2 10-08-2002 10:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:43 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