LinuxQuestions.org
Review your favorite Linux distribution.
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 03-04-2011, 12:51 PM   #1
eniv6208
LQ Newbie
 
Registered: Dec 2010
Location: Monterrey, Mexico
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Equivalent windows.h in Linux ?


Hello,

I need to move a small system from Windows to Linux; the problem is that it makes heavily use of windows.h stuff, like constants, functions, etc. The question is if is there anything similar to windows.h in Linux, that could be a Windows emulator, or whatever. Or is better that I write something like a linux.h (or any other name) to include in Linux all the stuff windows.h has, doing their respective adaptations of course, to make it available to the system I am moving to?

Thanks
 
Old 03-04-2011, 01:09 PM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Since you are changing OS's, there is more than simply getting your code to compile. Satisfying the syntax requirements of the toolchain is one thing, but don't forget that there are semantics behind all of the system calls, and that also needs to be reproduced. By your wording, 'it makes heavily use of windows.h stuff', so I think you can expect there to be a lot of work to port the code. At some point, it is probably better to simply re-write the code using Linux facilities, rather than trying to wedge the code into a foreign environment.

--- rod.
 
Old 03-04-2011, 01:46 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Yes, you'll need to rewrite it.

If you tell us what the Windows.h stuff in the program was doing, we can suggest Linux equivalents. Start by telling us which widget toolkit (gtk? qt?) you're using for the Linux version.
 
Old 03-04-2011, 01:57 PM   #4
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
Any reason you can't simply run it under WINE?
 
Old 03-04-2011, 02:04 PM   #5
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by eniv6208 View Post
Hello,

... that could be a Windows emulator, or whatever. ...
WINE: http://www.winehq.org/ .
 
Old 03-04-2011, 04:13 PM   #6
eniv6208
LQ Newbie
 
Registered: Dec 2010
Location: Monterrey, Mexico
Distribution: Ubuntu
Posts: 5

Original Poster
Rep: Reputation: 0
Yes, I think Wine could work. I still need to do many tests.


Thanks
Really appreciate.

Regards

Enrique
 
Old 03-04-2011, 04:17 PM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
You could run linux, then virtualize the windows box into a VM... qemu/xen/vmware etc...
 
  


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 equivalent to Windows Explorer sjia Linux - Software 22 10-13-2013 04:32 AM
What equivalent of MSDN (in MS Windows ) is in Linux Igor007 Programming 9 05-15-2009 09:35 AM
Linux Equivalent of Windows EXE rn5a Linux - Newbie 6 08-23-2007 01:21 PM
What is the equivalent of Windows events in Linux DavidW567 Programming 8 12-24-2004 05:14 PM
Linux equivalent to windows registry? marri Linux - Newbie 10 07-22-2004 12:07 AM

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

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