Compiling with Borland C++ Builder 6
Moderator: Moderator Team
Compiling with Borland C++ Builder 6
Hi,
Although I've been using dcmtk under Un*x environments for more than a year now, it's the first time I'm using the toolkit under Windows.
So, has anyone successfully compiled (and used) dcmtk on Windows using BCB6? And how, of course.
Thanks in advance,
Although I've been using dcmtk under Un*x environments for more than a year now, it's the first time I'm using the toolkit under Windows.
So, has anyone successfully compiled (and used) dcmtk on Windows using BCB6? And how, of course.
Thanks in advance,
Gabriel de Dietrich
Image Guided Therapy
Image Guided Therapy
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
We recently added some experimental support for Borland C++ (the free 5.5 version). If you insert the following code fragment into the main CMakeLists.txt file, you should be able to use CMake to generate makefiles for Borland:
Borland specific settings are already present in the configuration header file (cfwin32.h), so the compilation itself should work. Not much testing has been done with this port yet, though, so don't be too surprised if you run into problems
Code: Select all
# set project wide flags for compiler and linker
IF(CMAKE_CXX_COMPILER MATCHES bcc32)
# settings for Borland C++
SET(CMAKE_C_FLAGS "" CACHE STRING "Flags for C compiler." FORCE)
SET(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Win32 Debug Options C Code" FORCE)
SET(CMAKE_C_FLAGS_RELEASE "-O2" CACHE STRING "Win32 Release Options C Code" FORCE)
SET(CMAKE_CXX_FLAGS "" CACHE STRING "Flags used by the compiler during all build types." FORCE)
SET(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Win32 Debug Options C++ Code" FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "-O2" CACHE STRING "Win32 Release Options C++ Code" FORCE)
SET(CMAKE_STANDARD_LIBRARIES "import32.lib cw32mt.lib" CACHE STRING "Borland C++ Runtime Libraries" FORCE)
ELSE(CMAKE_CXX_COMPILER MATCHES bcc32)
# settings for Visual C++
SET(CMAKE_C_FLAGS "/nologo /W3 /GX /Gy /GR- /YX" CACHE STRING "Flags for C compiler." FORCE)
SET(CMAKE_C_FLAGS_DEBUG "/MTd /Z7 /Od" CACHE STRING "Win32 Debug Options C Code" FORCE)
SET(CMAKE_C_FLAGS_RELEASE "/MT /O2" CACHE STRING "Win32 Release Options C Code" FORCE)
SET(CMAKE_CXX_FLAGS "/nologo /W3 /GX /Gy /GR- /YX" CACHE STRING "Flags used by the compiler during all build types." FORCE)
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd /Z7 /Od" CACHE STRING "Win32 Debug Options C++ Code" FORCE)
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /O2" CACHE STRING "Win32 Release Options C++ Code" FORCE)
SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO" CACHE STRING "Win32 Linker Flags" FORCE)
ENDIF(CMAKE_CXX_COMPILER MATCHES bcc32)
Thanks. I did a fast first try but, as expected, didn't succeed.Borland specific settings are already present in the configuration header file (cfwin32.h), so the compilation itself should work. Not much testing has been done with this port yet, though, so don't be too surprised if you run into problems
Anyway, it doesn't matter any longer as we are going to switch to MSVC. It seems BCB is being less and less supported even by Borland themselves.
Thanks again,
Gabriel de Dietrich
Image Guided Therapy
Image Guided Therapy
-
- Posts: 25
- Joined: Wed, 2005-07-20, 22:42
- Location: Payson, Arizona
Borland C++
For anyone interested, I have compiled DCMTK using the Borland C++ 5.5, compiler (the so called free compiler).
I have run one of the apps (storescu) and it works fine so far.
To get the Borland make files built required a couple of additional tweaks,
so to save anyone else the trouble, I am prepared to post some notes on the procedure followed.
I will be doing some more work with this compiler, and will report on any further findings, as I go along.
Let me know if you need help on this, or would like to incorporate the mods into DCMTK
Irrespective of whether BCB is supported or not, the 5.5 compiler appears to be quite solid, and standards compliant, so I see it as a useful workhorse at the moment, 'till I determine what final requirements emerge
Regards,
Roy
I have run one of the apps (storescu) and it works fine so far.
To get the Borland make files built required a couple of additional tweaks,
so to save anyone else the trouble, I am prepared to post some notes on the procedure followed.
I will be doing some more work with this compiler, and will report on any further findings, as I go along.
Let me know if you need help on this, or would like to incorporate the mods into DCMTK
Irrespective of whether BCB is supported or not, the 5.5 compiler appears to be quite solid, and standards compliant, so I see it as a useful workhorse at the moment, 'till I determine what final requirements emerge
Regards,
Roy
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
-
- Posts: 25
- Joined: Wed, 2005-07-20, 22:42
- Location: Payson, Arizona
Compiling with Borland C++ 5.5
To fix the linker error:-
_errno not found
go into the file:
config\include\cfwin32.h
in the _BORLANDC section, add:
#define _MT to kick in the multitasking defs for errno
Hope this fixes your problem
Regards,
--Roy
_errno not found
go into the file:
config\include\cfwin32.h
in the _BORLANDC section, add:
#define _MT to kick in the multitasking defs for errno
Hope this fixes your problem
Regards,
--Roy
Compiling with Borland C++ 5.5
Thank you. This fixed my problem.
But now I have an other problem.
The codeguard detected errors in my program (Project1.cgl):
I compiled a simple C++ Builder application:
Regards,
Ronny
But now I have an other problem.
The codeguard detected errors in my program (Project1.cgl):
Code: Select all
Error 00001. 0x350010 (Thread 0x00F8):
Resource type mismatch: a(n) object array was expected.
delete[](0x01230004)
Call Tree:
0x00411ABB(=Project1.exe:0x01:010ABB)
0x00441CDE(=Project1.exe:0x01:040CDE)
0x00444D4E(=Project1.exe:0x01:043D4E)
0x0042F61D(=Project1.exe:0x01:02E61D)
0x0042418A(=Project1.exe:0x01:02318A)
0x00428C70(=Project1.exe:0x01:027C70)
The memory block (0x01230004) [size: 802816 bytes] was allocated with malloc
Call Tree:
0x00413728(=Project1.exe:0x01:012728)
0x004133D9(=Project1.exe:0x01:0123D9)
0x00412E2F(=Project1.exe:0x01:011E2F)
0x00444FB8(=Project1.exe:0x01:043FB8)
0x00481C68(=Project1.exe:0x01:080C68)
0x00486650(=Project1.exe:0x01:085650)
------------------------------------------
...
Code: Select all
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <dcmimage.h> /* for DicomImage */
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
DicomImage *image = new DicomImage("test.dcm");
if (image != NULL)
{
Edit1->Text = "Good!";
}
delete image;
}
//---------------------------------------------------------------------------
Ronny
-
- Posts: 25
- Joined: Wed, 2005-07-20, 22:42
- Location: Payson, Arizona
C++ builder
Sorry I cant help you with this one,
you are compiling and linking with the VCL which is another environment altogether.
another approach to take would be to compile your GUI application independently of the dcmtk, compile the (command line) dcmtk tools, then launch the tool(s) as separate processes, from your application to do the dicom work, and capture the results in your application.
Regards,
--roy
you are compiling and linking with the VCL which is another environment altogether.
another approach to take would be to compile your GUI application independently of the dcmtk, compile the (command line) dcmtk tools, then launch the tool(s) as separate processes, from your application to do the dicom work, and capture the results in your application.
Regards,
--roy
Compiling with Borland C++ 5.5
Thank you for the idea with the separate process.
But have anyone compile and link the dcmtk in a BCB 5.5 Project?
For example: in a dll?
Regards,
Ronny
But have anyone compile and link the dcmtk in a BCB 5.5 Project?
For example: in a dll?
Regards,
Ronny
Who is online
Users browsing this forum: No registered users and 1 guest