This is the mail archive of the
insight-prs@sources.redhat.com
mailing list for the Insight project.
insight/89: Cygwin build error
- To: insight-gnats at sourceware dot cygnus dot com
- Subject: insight/89: Cygwin build error
- From: bahrahm at yahoo dot com
- Date: 15 May 2001 15:56:36 -0000
- Reply-To: bahrahm at yahoo dot com
>Number: 89
>Category: insight
>Synopsis: Cygwin build error
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 15 09:03:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: bahrahm@yahoo.com
>Release: unknown-1.0
>Organization:
>Environment:
cygwin 1.1.18, gcc 2.95.2-6
>Description:
Yesterday, I checked out Insight source code and
tried to compile on Cygwin. And I got error messages.
The error message was about undeclared types such as
HKEY which is declared winreg.h in cmSystemTools.cxx file. Since windows.h includes winreg.h, the problem
seems to come from complier proprocess definitions.
==============Error Message======================
$ make
cd /cygdrive/d/insight_src/Cygwin/CMake/Source; make CMakeBuildTargets
make[1]: Entering directory `/cygdrive/d/insight_src/Cygwin/CMake/Source'
c++ -g -O2 -c ../../../Insight/CMake/Source/cmSystemTools.cxx -o cmSystemTool
s.o
../../../Insight/CMake/Source/cmSystemTools.cxx: In function `bool ReadAValue(st
ring &, const char *)':
../../../Insight/CMake/Source/cmSystemTools.cxx:207: `HKEY' undeclared (first us
e this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:207: (Each undeclared identifier
is reported only once
../../../Insight/CMake/Source/cmSystemTools.cxx:207: for each function it appear
s in.)
../../../Insight/CMake/Source/cmSystemTools.cxx:207: parse error before `;'
../../../Insight/CMake/Source/cmSystemTools.cxx:210: `primaryKey' undeclared (fi
rst use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:210: `HKEY_CURRENT_USER' undecla
red (first use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:214: `HKEY_CURRENT_CONFIG' undec
lared (first use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:218: `HKEY_CLASSES_ROOT' undecla
red (first use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:222: `HKEY_LOCAL_MACHINE' undecl
ared (first use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:226: `HKEY_USERS' undeclared (fi
rst use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:229: parse error before `;'
../../../Insight/CMake/Source/cmSystemTools.cxx:231: `KEY_READ' undeclared (firs
t use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:231: `hKey' undeclared (first us
e this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:231: implicit declaration of fun
ction `int RegOpenKeyEx(...)'
../../../Insight/CMake/Source/cmSystemTools.cxx:231: `ERROR_SUCCESS' undeclared
(first use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:237: `DWORD' undeclared (first u
se this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:237: parse error before `,'
../../../Insight/CMake/Source/cmSystemTools.cxx:238: `dwSize' undeclared (first
use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:240: `LPTSTR' undeclared (first
use this function)
../../../Insight/CMake/Source/cmSystemTools.cxx:240: parse error before `.'
../../../Insight/CMake/Source/cmSystemTools.cxx:248: confused by earlier errors,
bailing out
make[1]: *** [cmSystemTools.o] Error 1
make[1]: Leaving directory `/cygdrive/d/insight_src/Cygwin/CMake/Source'
make: *** [/cygdrive/d/insight_src/Cygwin/CMake/Source/CMakeBuildTargets] Error
2
===================================================
======= Source Code (cmSystemTools.cxx)=============
Line: 48
#if defined(_MSC_VER) || defined(__BORLANDC__)
#include <windows.h>
#include <direct.h>
Line: 179
#ifdef _WIN32
// Get the data of key value.
// Example :
// HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.1\InstallPath
// => will return the data of the "default" value of the key
// HKEY_LOCAL_MACHINE\SOFTWARE\Scriptics\Tcl\8.4;Root
// => will return the data of the "Root" value of the key
bool ReadAValue(std::string &res, const char *key)===================================================
>How-To-Repeat:
"Insight Source Directory"/configure
>Fix:
I added three lines:
#if def _WIN32
#include <windows.h>
#endif
at ther top of cmSystemTools.cxx and it seemed to solve
the problem.
>Release-Note:
>Audit-Trail:
>Unformatted: