I'm trying to run a file called configure.bat which contains the following:

echo off
mkdir Platforms
mkdir Platforms\bb2010wm
FOR /F "tokens=2* " %%A IN ('REG QUERY "HKLM\SOFTWARE\CodeGear\BDS\7.0" /v RootDir') DO SET BCB2010_ENV_ROOT=%%B
cd Platforms\bb2010wm
..\..\build\cmake\bin\cmake.exe -G "Borland Makefiles" -D CMAKE_C_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027 -w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-8030 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_CXX_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027 -w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-8030 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_C_COMPILER:PATH="%BCB2010_ENV_ROOT%Bin\\bcc32.exe" -D CMAKE_CXX_COMPILER:PATH="%BCB2010_ENV_ROOT%Bin\\bcc32.exe" -D ODA_HAS_OPENGL=1 -D ODA_OPENGL_LIBS="Opengl32.lib"  -D CMAKE_BUILD_TYPE=Release -D CMAKE_CONFIGURATION_TYPES=Release  ../../
cd ..\..\
set TAB=    
echo all: > Makefile
echo %TAB%cd Platforms\bb2010wm>>Makefile
echo %TAB%make all>> Makefile
echo clean: >> Makefile
echo %TAB%cd Platforms\bb2010wm>> Makefile
echo %TAB%make clean>> Makefile

My Borland C++ compiler is in "c:\Borland\BCC55\Bin\bcc32.exe"

I've set CMAKE_C_COMPILER="c:\Borland\BCC55\Bin\bcc32.exe"

But when I run the configure.bat I get the following error message:

C:\Documents and Settings\dave\My Documents\Borland>configure.bat

C:\Documents and Settings\dave\My Documents\Borland>echo off

Error: The system was unable to find the specified registry key or value
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: Bin//bcc32.exe
CMake Error: your C compiler: "Bin//bcc32.exe" was not found. Please set CMAKE
_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: Bin//bcc32.exe -- broken
CMake Error at build/cmake/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:56 (
MESSAGE):
The C compiler "Bin//bcc32.exe" is not able to compile a simple test
program.

It fails with the following output:

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)

CMake Error: your C compiler: "Bin//bcc32.exe" was not found. Please set CMAKE
_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "Bin//bcc32.exe" was not found. Please set CMA
KE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!

I sustpect it has something to do with the double forward slashes.

How can I rectify this?

You have double backward slashes, which will confuse a Windows machine. Change \\ to \ both places it appears.

When troubleshooting batch files like this, you should remove or comment out echo off; then you'll be able to see exactly what commands are being executed.

Hi Gusano, thanks very much for taking the time...

I've done as you suggested, but the program still can't seem to find the compiler.

It's strange because the Batch file is actually intended to be run on Windows, so whoever wrote it would have had reason to use the double backslashes. I'm not sure that I'm using the intended compiler, though; I don't have BCPP Builder and am more or less hoping that the BCC55 will suffice.

I'm actually running this on a Virtualbox VM using an XP Guest on a Linux host, but that wouldn't be the cause, would it?

I do have a machine with Windows 7 installed. I'll try running on that and see what happens...

Anyway the output of the configure.bat is as follows:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\dave>cd "My Documents\Borland"

C:\Documents and Settings\dave\My Documents\Borland>configure.bat

C:\Documents and Settings\dave\My Documents\Borland>mkdir Platforms

C:\Documents and Settings\dave\My Documents\Borland>mkdir Platforms\bb2010wm

C:\Documents and Settings\dave\My Documents\Borland>FOR /F "tokens=2* " %A IN ('REG QUERY "HKLM\SOFTWARE\CodeGear\BDS\7.
0" /v RootDir') DO SET BCB2010_ENV_ROOT=%B

Error:  The system was unable to find the specified registry key or value

C:\Documents and Settings\dave\My Documents\Borland>cd Platforms\bb2010wm

C:\Documents and Settings\dave\My Documents\Borland\Platforms\bb2010wm>..\..\build\cmake\bin\cmake.exe -G "Borland Makef
iles" -D CMAKE_C_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027 -w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-80
30 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_CXX_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027
-w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-8030 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_C
_COMPILER:PATH="Bin\bcc32.exe" -D CMAKE_CXX_COMPILER:PATH="Bin\bcc32.exe" -D ODA_HAS_OPENGL=1 -D ODA_OPENGL_LIBS="Opengl
32.lib"  -D CMAKE_BUILD_TYPE=Release -D CMAKE_CONFIGURATION_TYPES=Release  ../../
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: Bin/bcc32.exe
CMake Error: your C compiler: "Bin/bcc32.exe" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or n
ame.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: Bin/bcc32.exe -- broken
CMake Error at build/cmake/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:56 (MESSAGE):
  The C compiler "Bin/bcc32.exe" is not able to compile a simple test
  program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


CMake Error: your C compiler: "Bin/bcc32.exe" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or n
ame.
CMake Error: your CXX compiler: "Bin/bcc32.exe" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path
or name.
-- Configuring incomplete, errors occurred!

C:\Documents and Settings\dave\My Documents\Borland\Platforms\bb2010wm>cd ..\..\

C:\Documents and Settings\dave\My Documents\Borland>set TAB=

C:\Documents and Settings\dave\My Documents\Borland>echo all:  1>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        cd Platforms\bb2010wm 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        make all 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo clean:  1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        cd Platforms\bb2010wm 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        make clean 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>

Sorry.

I seem to be really confused.

The configure.bat calls 'cmake.exe' which appears to mangle the path to bcc32.exe.

Edited 3 Years Ago by davecoventry

Okay.

This is the output from the 'configure.bat' with the path to the compiler hard-coded in.

C:\Documents and Settings\dave\My Documents\Borland>configure.bat

C:\Documents and Settings\dave\My Documents\Borland>mkdir Platforms

C:\Documents and Settings\dave\My Documents\Borland>mkdir Platforms\bb2010wm

C:\Documents and Settings\dave\My Documents\Borland>FOR /F "tokens=2* " %A IN ('REG QUERY "HKLM\SOFTWARE\CodeGear\BDS\7.
0" /v RootDir') DO SET BCB2010_ENV_ROOT=%B

Error:  The system was unable to find the specified registry key or value

C:\Documents and Settings\dave\My Documents\Borland>cd Platforms\bb2010wm

C:\Documents and Settings\dave\My Documents\Borland\Platforms\bb2010wm>..\..\build\cmake\bin\cmake.exe -G "Borland Makef
iles" -D CMAKE_C_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027 -w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-80
30 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_CXX_FLAGS:STRING="-g0 -tWM -WU -x -xd -w-8012 -w-8027
-w-8026 -w-8066 -w-8022 -w-8004 -w-8057 -w-8088 -w-8030 -w-8072 -w-8060 -w-8008 -DWIN32 -D_UNICODE -DUNICODE" -D CMAKE_C
_COMPILER:PATH="C:\Borland\BCC55\Bin\bcc32.exe" -D CMAKE_CXX_COMPILER:PATH="C:\Borland\BCC55\Bin\bcc32.exe" -D ODA_HAS_O
PENGL=1 -D ODA_OPENGL_LIBS="Opengl32.lib"  -D CMAKE_BUILD_TYPE=Release -D CMAKE_CONFIGURATION_TYPES=Release  ../../
-- The C compiler identification is Borland 5.51
-- The CXX compiler identification is Borland 5.51
-- Check for working C compiler: C:/Borland/BCC55/Bin/bcc32.exe
-- Check for working C compiler: C:/Borland/BCC55/Bin/bcc32.exe -- broken
CMake Error at build/cmake/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:56 (MESSAGE):
  The C compiler "C:/Borland/BCC55/Bin/bcc32.exe" is not able to compile a
  simple test program.

  It fails with the following output:

   Change Dir: C:/Documents and Settings/dave/My Documents/Borland/Platforms/bb2010wm/CMakeFiles/CMakeTmp



  Run Build Command:make "cmTryCompileExec2791379885\fast"

  Makefile:31: *** missing separator.  Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


-- Configuring incomplete, errors occurred!

C:\Documents and Settings\dave\My Documents\Borland\Platforms\bb2010wm>cd ..\..\

C:\Documents and Settings\dave\My Documents\Borland>set TAB=

C:\Documents and Settings\dave\My Documents\Borland>echo all:  1>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        cd Platforms\bb2010wm 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        make all 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo clean:  1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        cd Platforms\bb2010wm 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>echo        make clean 1>>Makefile

C:\Documents and Settings\dave\My Documents\Borland>

It seems as though the BCC55 compiler is not sufficient.

Hm... Makefile:31: *** missing separator is suspicious; what's in cmTryCompileExec2791379885\fast?

This article has been dead for over six months. Start a new discussion instead.