Windows Building and #pragma comment( lib "xxx" );

I am in the process of upgrading to graphviz 2.30.1 and am having issues building my windows based graphviz lib (I use the layout engine and not much else).

There are a bunch of #pragma comment( lib, "xxx") statements which are insisting on including things that are not needed (expat, zlib and certain graphviz libraries).

Now I would like to "tidy" them up and have various choices:

1. Wrap them generically in an additional #ifdef AUTOINCLUDE_LIBS_ON_WINDOWS
2. Move them into seperate c files which can be optionally included in the build process.
3. Wrap them intelligently in #ifdef HAVE_XXX
4. Remove them entirely and write some cmake scripts to generate suitable projects (I don't know what peoples personal feelings are for cmake).

FYI I have "4" done already for the pieces I use...

Assuming people are happy with the approach, I can just issue a pull request in mercurial?

TIA,

Gordon.

We are not very well versed

We are not very well versed in the vagaries of Windows. We are certainly willing to consider adding any changes that may be useful. Off hand, your options 1 and 3 seem closest to what we currently do. For unix builds, we use the configure script to determine what parts are available and/or desirable, which produces the config.h file.

I'm not sure what type of graphs you are creating, but not using expat means that some important features of Graphviz are unavailable.

I now have a building copy on

I now have a building copy on windows (my OSX/Linux builds just worked).  In my situation I am building graphviz as a library (and a static one at that), which I call programtically to parse a DOT string, perform a layout and produce output as a SVG string.

At the end of the day I only needed to make 3 changes:

1.  Ensure the correct config.h file was being used:

2.  Wrap all #pragma comment ( LIb "xxx" ) in a #ifdef WIN32_DLL (IOW just ignore the linkage pragmas for static builds)

3.  Wrap some "#define extern declspec(dllimport/export)" in a #ifdef WIN32_DLL (most of them are correctly wrapped, but some new(?) ones were not).

The above changes were really only applied to the libs (as I don't build the cmd stuff).

Should I generate a mecurial pull request?

 

 

 

 

 

 

Please just send along the

Please just send along the changes and we'll see about getting them in the code base. Thanks.

Recent comments