Number: 1556
Title: Fix compilation problems using Visual Studio
Submitter: Jens-Malte Gottfried
Date: 27.01.2009
Subsys: build/installation
Version: graphviz version 2.20.3
System: Win32 (Vista), Visual Studio 2008
Severity: minor
Trying to compile a project of mine using CMake and Visual Studio I needed the graphviz libs also compiled with the MSVC compiler. The information in the file doc/winbuild.html were not of much help. Please update this help document or simplify the build procedure. The build.bat script does not work at all, using the visual studio workspace files, I finally reached the goal, but there were many hacks to do.
I created a detailed list of the steps I had to do to get the libraries compiled.

[erg] We are just completing an overhaul of building on Windows, to make sure we have libraries compatible with Visual Studio. We'll review your comments in light of the changes already made.
To get graphviz compiled using Visual Sudio (2008), I performed the following steps:

-	unpack graphviz-2.20.3.tar.gz
-	move the content of graphviz-2.20.3/windows/ to graphviz-2.20.3/
	(without overwriting existing files)
	because relative paths in solution and project files
	do not work otherwise
-	unpack to graphviz-2.20.3/
-	open graphviz-2.20.3/ws/graphviz.dsw (using visual studio)
-	accept the "convert to current version" dialog (yes to all)
-	change the following project properties for ALL projects
	(agraph - vpsc, multiple projects can be selected at once):
	-	C/C++ code generation from Multi-threaded Debug (/MTd)
		to Multi-threaded Debug DLL (/MDd) in Debug configuration
	-	C/C++ code generation from Multi-threaded (/MT)
		to Multi-threaded DLL (/MD) in Release configuration
	-	C/C++ general Debug Information Format
		from Program Database for Edit & Continue (/ZI)
		to C7 Compatible (/Z7) in Debug configuration,
		to avoid shipping the corresponding .pdb files around
	-	Disable Minimal Rebuild (/Gm) in Debug configuration
		(not compatible with /Z7)

- create new directory graphviz-2.20.3/lib/lib - create new directory graphviz-2.20.3/lib/lib/Debug - create new directory graphviz-2.20.3/lib/lib/Release

- in graphviz-2.20.3/lib/vpsc/csolve_VPSC.cpp change: - line 20: #include <variable.h> to #include "variable.h" - line 21: #include <constraint.h> to #include "constraint.h" - line 22: #include <generate-constraints.h> to #include "constraint.h" - line 23: #include <solve_VPSC.h> to #include "constraint.h"

- in the project "plugin" exclude/remove file gvrender_core.c from build

- in the project "neatogen" add existing file delaunay.c to sources list

- in graphviz-2.20.3/config.h add (e.g. at) Line 266: #define VERSION "2.20.3"

- in graphviz-2.20.3plugincoregvplugin_core.c comment out (unresolved externals): - line 24: // extern gvplugin_installed_t gvdevice_tk_types; - line 32: // extern gvplugin_installed_t gvrender_tk_types; - line 43: // {API_device, &gvdevice_tk_types}, - line 51: // {API_render, &gvrender_tk_types},

- fix project dependencies (only the minimal dependencies to make the solution compile and link are shown here): - lefty depends on gfx - dot depens on cdt

- Now build the solution (in Debug and/or Release mode) - The libraries can be found in graphviz-2.20.3/lib/lib/Debug and in graphviz-2.20.3/lib/lib/Release

Owner: *
Status: *