[Cmake] CMAKE for Borland C++ Builder/Win32: linker flag

Stefan Kowski stefan.kowski at gmx.de
Mon Oct 14 05:11:24 EDT 2002


Hi,

I just tried to compile a Borland C++ Builder 4 GUI application with CMAKE.
The link failed because of an unresolved external '_main', referenced by
C0X32.OBJ. This is because of an invalid command line option in the Borland
Makefile generated by CMAKE.

The CMakeList.txt file:

	PROJECT (CMAKETEST)

	ADD_DEFINITIONS(-D_RTLDLL -DUSEPACKAGES)

	SET(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -L..")

	LINK_LIBRARIES(vcl40 cw32mt)

	SET(CMAKETEST_SRCS Project1.cpp Unit1.cpp)

	ADD_EXECUTABLE(CMakeTest WIN32 ${CMAKETEST_SRCS})

In the CMAKE source file I found (cmake 1.4.5, class
cmBorlandMakefileGenerator, function OutputExecutableRule):

	if(t.GetType() == cmTarget::WIN32_EXECUTABLE)
	{
		command +=  " -tWM ";		=> multithreaded console application
(implies -tWC!)
	}

This should be changed to:

	if(t.GetType() == cmTarget::WIN32_EXECUTABLE)
	{
		command +=  " -tW -tWM ";	=> multithreaded Windows application
	}

I would be glad if this correction can be added to the source code.

Note: I do not know if this switch '-tW' is working with Builder versions
5.x/6.x, maybe someone can test this.

Stefan




More information about the CMake mailing list