Documention to develop application linking to DCMTK libraries and including required DCMTK files
Moderator: Moderator Team
Documention to develop application linking to DCMTK libraries and including required DCMTK files
Hi,
I am looking for some documentation which describes in details how we can link to DCMTK libraries and develop our own executable. Some documentation that mentions the include files that needs to be included in my application and what all libraries I need to link to for developing a GUI based Query/ Retrieve tool for example.
Does such a documentation exist somewhere?
I am looking for some documentation which describes in details how we can link to DCMTK libraries and develop our own executable. Some documentation that mentions the include files that needs to be included in my application and what all libraries I need to link to for developing a GUI based Query/ Retrieve tool for example.
Does such a documentation exist somewhere?
Hi sas,
I just downloaded this package last night and in the FAQ there is a question titled "Where is the rest of the documentation?" The answer was that as of version 3.5 there are a few simple examples in the doc folders of each sub folder, but I am running into the same exact problem - what headers do I need and what libraries should I link to?
I have attempted this as a test:
[code]
int main()
{
DicomImage *image = new DicomImage("C:\\test.dcm");
}
[/code]
But I received a ton of link errors naturally. I have one more linking error:
LNK2019: unresolved external symbol _Netbios@4 referenced in function "unsigned char * __cdecl getMACAddress(unsigned char * const)
Does anyone know which lib this is in, I cannot find it!
Thanks,
Mark
I just downloaded this package last night and in the FAQ there is a question titled "Where is the rest of the documentation?" The answer was that as of version 3.5 there are a few simple examples in the doc folders of each sub folder, but I am running into the same exact problem - what headers do I need and what libraries should I link to?
I have attempted this as a test:
[code]
int main()
{
DicomImage *image = new DicomImage("C:\\test.dcm");
}
[/code]
But I received a ton of link errors naturally. I have one more linking error:
LNK2019: unresolved external symbol _Netbios@4 referenced in function "unsigned char * __cdecl getMACAddress(unsigned char * const)
Does anyone know which lib this is in, I cannot find it!
Thanks,
Mark
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
See also FAQ #27.
Hi,
I still have problems in linking my application which provides the same fuctionality as findscu application does, and also has a GUI to it. I am developing my application on Windows XP platform and have linked to the following libraries:
dcmdata.lib ofstd.lib netapi32.lib wsock32.lib dcmnet.lib
in the order mentioned.
I still get the following linking error, anyone knows why:
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in ......
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in ..........
ofstd.lib(ofthread.obj) : error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall OFThread::start(void)" (?start@OFThread@@QAEHXZ)
ofstd.lib(ofthread.obj) : error LNK2019: unresolved external symbol __endthreadex referenced in function "protected: static void __cdecl OFThread::thread_exit(void)" (?thread_exit@OFThread@@KAXXZ)
I still have problems in linking my application which provides the same fuctionality as findscu application does, and also has a GUI to it. I am developing my application on Windows XP platform and have linked to the following libraries:
dcmdata.lib ofstd.lib netapi32.lib wsock32.lib dcmnet.lib
in the order mentioned.
I still get the following linking error, anyone knows why:
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Lock(void)" (?_Lock@_Mutex@std@@QAEXXZ) already defined in ......
libcpmtd.lib(xmutex.obj) : error LNK2005: "public: void __thiscall std::_Mutex::_Unlock(void)" (?_Unlock@_Mutex@std@@QAEXXZ) already defined in ..........
ofstd.lib(ofthread.obj) : error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall OFThread::start(void)" (?start@OFThread@@QAEHXZ)
ofstd.lib(ofthread.obj) : error LNK2019: unresolved external symbol __endthreadex referenced in function "protected: static void __cdecl OFThread::thread_exit(void)" (?thread_exit@OFThread@@KAXXZ)
Hi,
This is in continuation with my previous post. While linking to the libraries, I have excluded the "LIBCMTD.lib" from the set of default libraries to be linked to, because of linking errors saying that many of the methods have been already defined in "LIBCD.lib".
If I include "LIBCMTD.lib" and exclude "LIBCD.lib", I get unresloved symbol "_errno".
I am comipling in Visual Studio .NET 2003.
Any help is highly appreciated.
Thanks,
sas
This is in continuation with my previous post. While linking to the libraries, I have excluded the "LIBCMTD.lib" from the set of default libraries to be linked to, because of linking errors saying that many of the methods have been already defined in "LIBCD.lib".
If I include "LIBCMTD.lib" and exclude "LIBCD.lib", I get unresloved symbol "_errno".
I am comipling in Visual Studio .NET 2003.
Any help is highly appreciated.
Thanks,
sas
Are you sure you compiled your GUI app and the dcmtk toolkit with the same runtime library, and use of MFC? Are you sure you're linking to the same release version of the compilation (ie: don't link you're release compiled GUI app to the debug compilation of dcmtk).
What is your configuration anyways?
What is your configuration anyways?
Hi,
I am trying to link the Debug version of my application to the Debug version of dcmtk. Any clues as to why I am getting linking errors as mentioned in my previous posts??
Congfiguration- Debug
Platform- Win32
Command line options as displayed when clicked at "Command Line" under "Linker" on the project property page:
/OUT:"Debug/tryDcmtk.exe" /INCREMENTAL /NOLOGO /LIBPATH:"..\dcmtk-3.5.3\dcmdata\libsrc\Debug" /LIBPATH:"..\dcmtk-3.5.3\ofstd\libsrc\Debug" /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" /LIBPATH:"..\dcmtk-3.5.3\dcmnet\libsrc\Debug" /NODEFAULTLIB:"LIBCD.lib" /DEBUG /PDB:"Debug/tryDcmtk.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 dcmdata.lib ofstd.lib netapi32.lib wsock32.lib dcmnet.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "..\dcmtk-3.5.3\dcmdata\libsrc\Debug\dcmdata.lib" "..\dcmtk-3.5.3\ofstd\libsrc\Debug\ofstd.lib" "..\dcmtk-3.5.3\dcmnet\libsrc\Debug\dcmnet.lib"
I am trying to link the Debug version of my application to the Debug version of dcmtk. Any clues as to why I am getting linking errors as mentioned in my previous posts??
Congfiguration- Debug
Platform- Win32
Command line options as displayed when clicked at "Command Line" under "Linker" on the project property page:
/OUT:"Debug/tryDcmtk.exe" /INCREMENTAL /NOLOGO /LIBPATH:"..\dcmtk-3.5.3\dcmdata\libsrc\Debug" /LIBPATH:"..\dcmtk-3.5.3\ofstd\libsrc\Debug" /LIBPATH:"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Lib" /LIBPATH:"..\dcmtk-3.5.3\dcmnet\libsrc\Debug" /NODEFAULTLIB:"LIBCD.lib" /DEBUG /PDB:"Debug/tryDcmtk.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 dcmdata.lib ofstd.lib netapi32.lib wsock32.lib dcmnet.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "..\dcmtk-3.5.3\dcmdata\libsrc\Debug\dcmdata.lib" "..\dcmtk-3.5.3\ofstd\libsrc\Debug\ofstd.lib" "..\dcmtk-3.5.3\dcmnet\libsrc\Debug\dcmnet.lib"
-
- DCMTK Developer
- Posts: 117
- Joined: Tue, 2004-11-02, 17:21
- Location: Oldenburg, Germany
- Contact:
We dont have any experience with Visual Studio .NET 2003, I dont even have that compiler on my machine since we are still using MSVC6 for DCMTK. But the problem is very very probably located in the "runtime library" settings for both projects: please pay attention to (what in MSVC6 is labeled) the "Code generation" -> "Runtime library" combobox in the project settings. You have to pick the same setting here for both projects, DCMTK and your GUI.
For DCMTK, the default setting in this combobox is "Multithreaded" (not "Single threaded" or "Multithreaded DLL" or any of the other options), so for your GUI, the same has to be applied. As I dont have Visual Studio .NET 2003 available here, I cannot tell you where you can find that setting, I am sorry. Maybe somebody else can tell you.
For DCMTK, the default setting in this combobox is "Multithreaded" (not "Single threaded" or "Multithreaded DLL" or any of the other options), so for your GUI, the same has to be applied. As I dont have Visual Studio .NET 2003 available here, I cannot tell you where you can find that setting, I am sorry. Maybe somebody else can tell you.
Linking to DCMTK for MATLAB mex Files
The MATLAB mathematical software has built-in supported for the DICOM format, but since all the code is written in the interpreted MATLAB language, it is unbearably slow. I'd like to use DCMTK and MATLAB's ability to use compiled C code in "mex" files in order to speed up the reading of DICOM files. ("mex" files are simply .dll's that MATLAB can call like a function.)
Anyway, I compiled the libraries necessary to use the DicomImage class (ofstd, dcmdata, and dcmimgle) and figured out that I had to additionally link to wsock32.lib and netapi32.lib based on linker errors. Even so, I still get the following linker error:
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
This error indicates to me that the compiler/linker thinks I'm trying to make a console or GUI application with a main() function required, instead of a .dll. Although I'm compiling the .dll within the MATLAB environment, I've set it to use the MSVStudio compiler. I've never had any problems like this in the past when making .dll's for MATLAB, so I'm wondering if the DCMTK needs to be specifically configured for use in .dll's rather than applications.
Any ideas? Thanks!
Anyway, I compiled the libraries necessary to use the DicomImage class (ofstd, dcmdata, and dcmimgle) and figured out that I had to additionally link to wsock32.lib and netapi32.lib based on linker errors. Even so, I still get the following linker error:
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
This error indicates to me that the compiler/linker thinks I'm trying to make a console or GUI application with a main() function required, instead of a .dll. Although I'm compiling the .dll within the MATLAB environment, I've set it to use the MSVStudio compiler. I've never had any problems like this in the past when making .dll's for MATLAB, so I'm wondering if the DCMTK needs to be specifically configured for use in .dll's rather than applications.
Any ideas? Thanks!
Who is online
Users browsing this forum: No registered users and 1 guest