Results 1 to 2 of 2
hi friends,
I have a task to convert a windows based C code into a Linux Based C code. i am completely new to the C programming language on linux. ...
- 05-11-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 1
hi forum
hi friends,
I have a task to convert a windows based C code into a Linux Based C code. i am completely new to the C programming language on linux. would appriciate some help as to what needs to be changed in the below mentioned code for it to run suceessfully on linux
i was getting errors while i was trying to complie the code using the
-- gcc -o destination_filename source_filename.c
command
thanks for the help in advance
code is attached as an attachment to this post
- 05-11-2009 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
You have a lot to do to convert this multi-threaded application from WIndows to Linux/Posix systems. Linux does not use HANDLE or DWORD types, and the threading model is quite different in implementation and usage. You need to learn how to use Posix threads - I would suggest that you get the book "Modern Multithreading" by Wiley Publishing. Amazon.com has it (I got my copy from them). It covers WIndows and Posix threading for C/C++ and should provide the information on multithreading that you need for this project.
FWIW, when developing applications that have to work on both Windows and Unix/Linux systems, I take the parts that are very different on the two types of systems and put those operations in wrapper functions and/or classes that can be implemented very differently on each platform type. That way, the actual application code is identical on all systems, and porting and enhancing becomes quite straight forward. I did that for a database access class library so that the differences between any dbms was just a couple of methods in one class. Using a shared library for that, we could run the same set of application servers (dozens of types) using any dbms (oracle, sybase, informix, ingres, db2) simply by telling the servers to load a different shared library. It worked indentically, using the exact same code base, on Windows servers as well as just about every variety of big-iron Unix system.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote