[vtkusers] Can VTK be used with Codegear XE4 compilers???

Bo Berglund bo.berglund at gmail.com
Sun Aug 4 17:31:27 EDT 2013


On Fri, 2 Aug 2013 14:26:57 -0600, David Gobbi <david.gobbi at gmail.com>
wrote:

>If bcc works after you add a space after the -L, then the next step is
>to modify your copy of cmake.  Compilation with bcc is controlled by
>the following file within your cmake distrubution:
>
>Modules/Platform/Windows-Embarcadero.cmake
>
>Inside that file, you can fine this line:
>
>SET(CMAKE_LIBRARY_PATH_FLAG "-L")
>
>and change it to this (i.e. add the space)
>
>SET(CMAKE_LIBRARY_PATH_FLAG "-L ")
>
>If that allows you to build VTK, then you can share the fix with the
>CMake developers.
>

This suggestion did not cut it, but I managed to get a bit further by
googling the actual error message "Fatal: Expected an option: LC:".

Among the hits I found some that were directly towards the Borland
compilers and there were two suggestions:
1) Double check that there aren't duplicates of bcc32.cfg ilink32.cfg
on the path or in the source folder. This was negative for me.

2) Check that these files, which should be in the Embarcadero
compiler's bin dir, contain the proper settings. The proper setting
turns out to be:

bcc32.cfg:
-I"C:\Programs\Embarcadero\RAD
Studio\11.0\include";"C:\Programs\Embarcadero\RAD
Studio\11.0\include\dinkumware"
-L"C:\Programs\Embarcadero\RAD Studio\11.0\lib"

ilink32.cfg:
-L"C:\Programs\Embarcadero\RAD Studio\11.0\lib"

My default cfg files from installing XE4 contained long lines of other
options in addition to these (; separated).
After making sure the files contain the suggested content and nothing
more the CMake Configure process advances a bit but still there is an
error at the end of the first test:

  Linking C executable cmTryCompileExec2774491527.exe

  	C:\Programs\EMBARC~1\RADSTU~1\11.0\bin\bcc32.exe -tR
  -ecmTryCompileExec2774491527.exe -tM -lS:1048576 -lSc:4098
-lH:1048576
  -lHc:8192 -tC -tM -O2 -DNDEBUG import32.lib
  "CMakeFiles\cmTryCompileExec2774491527.dir\testCCompiler.c.obj" 

  Embarcadero C++ 6.60 for Win32 Copyright (c) 1993-2013 Embarcadero
  Technologies, Inc.

  Turbo Incremental Link 6.50 Copyright (c) 1997-2013 Embarcadero
  Technologies, Inc.

  Fatal: Unable to open file 'C0X32.OBJ'

Next I Googled this new error message and found a whole lot of hits
from at least the last 10 years.

Some suggest it has to do with a setting to debug the source code:
http://cboard.cprogramming.com/cplusplus-programming/126516-borland-cplusplus-complier-error-missing-cox32-obj.html#post943684
Here they state that the compiler option -v must be removed.
But I have no idea how to tell CMake to not use this swithch...

There was also a hit from the horse's mouth (Embarcadero):
http://edn.embarcadero.com/article/27343
It is not exactly the same error message though even though it
involves cox32.obj:

<quote>
What this error really means is that the linker cannot find the
entry-point function for your program. 'c0x32.obj', which is the
startup code for a console application, is asking the linker to find a
function named 'main', the standard C/C++ entrypoint. The linker has
searched the project's object files and libraries, but cannot find the
'main' function.

This kind of error is usually caused by some mix-up between the
intended project type and the actual project type. For instance, if
you chose File, New, Console Wizard, checking 'Console Application',
but proceeded to write a windows-style application, with a WinMain
entrypoint, this is exactly the error you would receive. To remedy the
problem, you would create a new project, of the correct type, and add
your source files to the new project.

If compiling from the command line, the "target" options are analogous
to the project type, and must likewise, be consistent with the
application you're writing. The following list shows the BCC32.EXE
options and their intended targets:
-W 	Target is Windows application ("WinMain" entrypoint)	
-TC 	Target is console application ("main" entrypoint)	
-WD 	Target is a DLL ("DllMain" entrypoint)	
</quote>

So maybe CMake is setting the wrong project type for VTK?
In that case: where is it set and how does one fix it?

FINAL TRY:
I created a Hello World program and tried to compile it on the command
line:

#include <stdio.h>
int main(void) /* or char **argv */
{
printf("Hello, world!\n");
return 0;
}

Result:

C:\Engineering\TEST>bcc32 -I"C:\Programs\Embarcadero\RAD
Studio\11.0\include\windows\crtl" -L"C:\Programs\Embarcadero\RAD
Studio\11.0\lib\win32" test.cpp
Embarcadero C++ 6.60 for Win32 Copyright (c) 1993-2013 Embarcadero
Technologies, Inc.
test.cpp:
Turbo Incremental Link 6.50 Copyright (c) 1997-2013 Embarcadero
Technologies, Inc.
Fatal: Unable to open file 'C0X32.OBJ'

Same problem....
Any ideas?


-- 
Bo Berglund
Developer in Sweden




More information about the vtkusers mailing list