Instructions for Visual Studio .Net

Hampton-Smith, Paul T [IBM GSA] Paul.Hampton-Smith at team.telstra.com
Thu Mar 7 18:44:12 EST 2002


After being greatly helped by some instructions some time back for setting
up a GaLib project in MSVC++ V6, I should return the favour by posting some
help to those porting to the C++ V7 in Visual Studio .Net.

Initially, I simply opened my existing GaLib 245 workspace in V7.  The V6
workspace produces a static library .LIB file -- compiler switch /TP is
added to ensure that the .C files are treated as C++.  

V7 uses a new construct called a 'Solution', and offered to migrate the
workspace into this.  But when I tried to compile, I got thousands of syntax
errors from cstdio and cstdlib.

To cut a long story short, I have found that the .C files were being treated
as C rather than C++, even though the /TP compiler switch was included.  My
solution, which unfortunately breaks the cross-platform capability of the
code, is to rename *.C to *.CPP in the entire package.  Once the files
themselves have been renamed, an easy way to update the various #include *.C
statements in the code is to compile and follow the errors generated.

There are also lots of C4244 warnings about possible loss of data converting
from double to float.  I suggest re-introducing the #pragma line in
gaconfig.h to remove these.

I still have some work to do.  The .LIB file generated even in release mode
is much larger, so I'm concerned that performance may suffer.  There are
several new optimisation options in the new compiler which I have yet to
explore.

Paul Hampton-Smith




More information about the galib mailing list