ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.