Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting Visual Studio 6 Libraries To Visual Studio 10

I am just looking at the options for now but I have a large number of C libraries that were written in Visual Studio 6 as statically linked .lib. Newer development needs to be done in Visual Studio 2010 that will call these libraries and it has been decided that although there are possible solutions to calling these old libraries, that they should be updated to Visual Studio 2010. As part of that conversion, it is looking likely that we might as well convert them to an OO language. Whether that be C++, C++/CLR or C# is up for discussion.

New applications may be written in C# that will call these libraries.

What would be best to convert the libraries to? It also needs to be a fairly straightforward (i.e. not too time consuming) option. I think converting them to C# will be too much work. Unmanaged C++ would be the easiest but would C++/CLR be a good middle ground? I am thinking here that it is easier to call C++/CLR from C# than unmanaged C++ and therefore would be worth the little more work here

like image 989
Jonnster Avatar asked Dec 03 '25 09:12

Jonnster


1 Answers

Rewriting from scratch is not an option. There are over 100 libraries and a lot of code.

If rewritting them is not an option I don't understand this statement.

As part of that conversion, it is looking likely that we might as well convert them to an OO language. Whether that be C++, C++/CLR or C# is up for discussion.

You cannot "convert" C code to C# and/or C++/CLR code. The only correct term would be a total and complete rewrite. It sounds like your better of just loading the project in the newest visual studio and compiling it as is.

If it already works there is no reason to change the language the dll is written in.

By the sounds of it...You don't seem to be familar with any of the languages your suggesting considering you had a question about the term unmanaged C++.

We have already gone down the route of leaving these libraries as C written in VS 6 and trying to call them from C# written in VS 2010. It got a little messy and it was decided that this was not a good long term direction.

This means your only real choice is to rewrite the libraries so they are easier to work with. Just switching to C++ will not solve the problems you ran into. You can use C style conventions within C++ without an issue.

like image 54
Security Hound Avatar answered Dec 05 '25 22:12

Security Hound



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!