error building on Windows

From: Tom Roberts <tjrob_at_fnal.gov>
Date: Wed, 6 Aug 2008 11:39:27 -0500


I decided to start over from scratch. I'm using Cygwin and MS VC++ express edition 2008; using this environment I have successfully built Coin, CLHEP, Geant4, and my program without Root. To build Root, I used all defaults in configure, and the basic make worked. But making the static libs fails:

	make static
	...
	LINK : fatal error LNK1181: cannot open input file
	    'lib/libfreetype.a'
	make: *** [static] Error 157

I note that lib/libpcre.a is also not going to be found (it's listed next on the command that failed). But lib/libRoot.a is there (182 Megabytes). So I'll link with the dynamic libs :-(.

When I make my program I get:

     c:\root\include\RConfig.h(480) : fatal error C1189: #error :
         Missing #include of %ROOTSYS%\include\w32pragma.h!
     make: *** [g:/g4bl/tmp/WIN32-VC/g4beamline/RootNTuple.o] Error 2

In my code, just one source file references Root (RootNTuple.cc), so I added the obvious include to it, and it now compiles with warnings about redefinitions of _SECURE_SCL and _USE_ATTRIBUTES_FOR_SAL. The file has an include for each Root class it uses:
#ifdef WIN32
#include "w32pragma.h"
#endif
#include "TROOT.h"
#include "TPluginManager.h"
#include "TFile.h"
#include "TNtuple.h"
#include "TDirectory.h"

Linking succeeds with $(shell $(ROOTSYS)/bin/root-config --libs). Copying $ROOTSYS/bin/*.dll to my bin directory gets it to work. HURRAY!

That is 52 MegaBytes of DLLs, which will almost double the size of my distribution -- is there any way to get static linking to work on Windows?

Tom Roberts Received on Wed Aug 06 2008 - 18:45:27 CEST

This archive was generated by hypermail 2.2.0 : Sat Aug 09 2008 - 11:50:01 CEST