473,785 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c program porting from Windows to UNIX

1 New Member
I worked on c/c++ executable file building on Windows platform before. Now, there is a need to port my c/c++ program from Windows to UNIX platform, and I have no experience in this at all. Anybody have step by step guidance on the porting work? First thing that I faced is, it has #include <windows.h> on Windows, what is the equivalent in Unix? Thanks a lot.
Sep 7 '07 #1
5 2631
sicarie
4,677 Recognized Expert Moderator Specialist
Are you using the Win32 API? If so, you'll have to find the equivalent functions in Unix. I would start by Google searching the flavor of Unix you are using and "API".
Sep 7 '07 #2
weaknessforcats
9,208 Recognized Expert Moderator Expert
If this is a graphical program, there is no Unix equivalent. You will need to recode the entire application uisng a Unix supported environment, like Motif.
Sep 7 '07 #3
smalpani
29 New Member
I think there is a fundamental difference between windows style programming starting with WinMain and UNIX style programs.

I think you can have most of the code that has algorithm etc.

but you will have to do a lot of re-structuring.
Sep 7 '07 #4
RRick
463 Recognized Expert Contributor
One of the first places to start is to figure out how to build the project. Windows uses VC++(workspaces and projects) and unix uses makefiles.

Before jumping into the quagmire of makefiles, I would look for an unix based IDE program that can read/convert the windows workspace and project files for the unix platform.

I have heard of Eclipse for C++, but have never used it. If you find one, let us know.
Sep 7 '07 #5
weaknessforcats
9,208 Recognized Expert Moderator Expert
There is a solution here and one that could maake you a lot of money.

That is, write a CLR for C# that runs on Unix/Linux. All you need to is process the MSIL code that is the result of the C# and other .NET compilers. MSIL format is public domain so you don't need a license.

When this works ALL Windows .NET code will run on Unix/Linux.
Sep 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3373
by: eichin | last post by:
One of my recent projects has involved taking an accretion of sh and perl scripts and "doing them right" - making them modular, improving the error reporting, making it easier to add even more features to them. "Of course," I'm redoing them in python - much of the cut&paste reuse has become common functions, which then get made more robust and have a common style and are callable from other (python) tools directly, instead of having to...
1
3004
by: Will Stuyvesant | last post by:
I never used the popen or popen2 libraries but it is my understanding that they can capture the output of console based programs. Is it also possible to send keystrokes to console base programs? I would like to program a Python program that can play for instance the tty version of nethack 3.4.3 on Windows, simulating a human player: for nethack it would not be possible to know if a human or a computer program is playing it. It is a...
6
2579
by: Kyle | last post by:
Hello all! I'm looking into developing a biological program for modeling and sequencing DNA and other biological processes. The program's main focus would be to look for similarities and differences between different models of experiments. I would also being using information from this website in my work also: http://www.ncbi.nlm.nih.gov/
50
3015
by: strutsng | last post by:
I want if "a C program is a standard C++ program, but not vice versa" is a correct statement? In a C++ program, we can use standard C libraries. However, we cannot use C++ libraries inside C program. Please advise. thanks!!
34
4077
by: subramanian100in | last post by:
Is there any difference between porting and migrating. Kindly explain
7
15665
by: Lior | last post by:
Hi, I have small code, that compiles on Visual C++ into a shared library (DLL). I need to compile it under linux, but the code includes some data types I'm not familiar with, such as DWORD, HANDLE, __int64, ULONG etc. What are those words?
7
2339
by: zman77 | last post by:
Hi. I have a project (multiple header and source files) that was written in C, in unix. I made a new C++ project in MSVS 2005 (blank project), and am trying to simply copy the C code to my new C++ project. I thought the main problem I'd face would be finding the equivalent libraries for windows, however, I ran into another issue. I get the following error: error C2036: 'void *' : unknown size The line in question: if(v->cmp(k,...
5
4111
by: nleschov | last post by:
Hello, I'm working on a project that involves embedded controllers communicating over modbus. I would like to use a well-written modbus library to add modbus functionality to my project and I found libmodbus: https://launchpad.net/libmodbus/ My controllers are in fact embedded PCs running DOS-compatible OS, CPU is Intel 80188-compatible. My compiler is Borland C++ 5.02 on Windows,
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9953
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8978
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.