Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in converting a Unix-based C library to VC++ library or dll 1

Status
Not open for further replies.

drizet

Programmer
Mar 26, 2001
6
US
I have to convert a unix based library that we developed to a VC++ library or dll. Each function is in its own separate C file. The library contains several headers files that have #defines, a lot of structures and functions prototypes.

I need to link this into a dialog-based application I created using VC++ 6.0.

What is the best approach or starting point for this conversion? My first thought was to use the VC++ app wizard to create a Win32 DLL or Static Library. I would add all the functions to the created C++ file and header file defining the ones that need to be private and public. The problem I have is how to handle or convert all the #def's and structures.

Thanks for any help you can provide to me.

Scott Urban
Sr. Software Engineer
Lockheed Martin Astronautics
 
I would see what happens when you try to make the Win32.dll project in VC++. Dont forget to export the functions you want but the main thing I would first look into is if there will be any ENDIAN problems. If this old code was done on a HP and you are going to a windows platform, you may see some really strange errors.

Matt
 
Actually, you don't need to get rid of the #define's and structures - VC++ can handle C code quite easily. Most of the work you'll need to do would involve any Unix specific system calls and data structures. If most of the library was written in ANSI C, your work should be minimal - just create a blank .lib or .dll project, add the appropriate files, and make necessary changes to export your functions. Then make sure you alter any system calls that are Unix specific into Windows system calls.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top