Errors while compiling dcmtk 3.6.0 with VC++ 6.0
Moderator: Moderator Team
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Errors while compiling dcmtk 3.6.0 with VC++ 6.0
Hello everyone,
Does anyone has seen this error:
dcmtk-3.6.0\dcmjpls\libcharls\scan.h(780) : error C2899: typename cannot be used outside a template declaration
during compilation?
if someone could give me some suggestions, thanks by advance!
Does anyone has seen this error:
dcmtk-3.6.0\dcmjpls\libcharls\scan.h(780) : error C2899: typename cannot be used outside a template declaration
during compilation?
if someone could give me some suggestions, thanks by advance!
Last edited by liuxinming on Wed, 2013-07-10, 10:46, edited 1 time in total.
-
- Posts: 61
- Joined: Wed, 2010-05-19, 09:27
- Location: Taipei, Taiwan
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
Have you defined the activate "HAVE_TYPENAME" ?
Hint: in osconfig.h,
Hint: in osconfig.h,
Code: Select all
/* define if the compiler recognizes typename */
#define HAVE_TYPENAME 1
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
I' ve just opened osconfig.h and seen these two lines you' ve mentioned. So What shall I do next?Chung-Yueh Lien wrote:Have you defined the activate "HAVE_TYPENAME" ?
Hint: in osconfig.h,Code: Select all
/* define if the compiler recognizes typename */ #define HAVE_TYPENAME 1
-
- Posts: 61
- Joined: Wed, 2010-05-19, 09:27
- Location: Taipei, Taiwan
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
you can try to deactivate HAVE_TYPENAME.
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
Done! Thanks a lot!
But there is another problem which being described as follow:
dcmimgle\libsrc\didispfn.cxx(347) :error C2039: 'nocreate' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'
Since C++ no longer supports ios::nocreate, what do I have to do with this issue?
But there is another problem which being described as follow:
dcmimgle\libsrc\didispfn.cxx(347) :error C2039: 'nocreate' : is not a member of 'basic_ios<char,struct std::char_traits<char> >'
Since C++ no longer supports ios::nocreate, what do I have to do with this issue?
-
- Posts: 61
- Joined: Wed, 2010-05-19, 09:27
- Location: Taipei, Taiwan
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
Hi, please take a look at dcmconfig.h and find something like this:
enable the flag "HAVE_IOS_NOCREATE" and run CMake to make a correct configuration.
Code: Select all
Define if your system defines ios::nocreate in iostream.h */
/* #undef HAVE_IOS_NOCREATE */
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
It did the trick. I' ve modified this flag.Chung-Yueh Lien wrote:enable the flag "HAVE_IOS_NOCREATE" and run CMake to make a correct configuration.
One more problem is that this error:
error C2733: second C linkage of overloaded function 'wmemchr' not allowed
appeared while compiling
I know that it is related to C linkage and I' ve searched all the configurations in osconfig.h and didn' t find anything about it.
Shall I modify some flags elsewhere?
-
- Posts: 61
- Joined: Wed, 2010-05-19, 09:27
- Location: Taipei, Taiwan
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
It's caused by more than one overloaded function "wmemchr" is declared with C linkage. Also, DCMTK does not include wmemchr function, i.e. at least I have checked it. The solution is as following (I did not test it!):liuxinming wrote: One more problem is that this error:
error C2733: second C linkage of overloaded function 'wmemchr' not allowed
appeared while compiling
Code: Select all
#ifdef __cplusplus
extern "C"
{
#endif
#include <wchar.h>
#ifdef __cplusplus
}
#endif
-
- Posts: 83
- Joined: Thu, 2009-03-19, 04:19
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
I' ve found the following codes in osconfig.h:
and I replaced them with the codes you' ve written above, this error did not arise any more.
My Last two questions are both about warnings
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
warning C4273: 'mktemp' : inconsistent dll linkage. dllexport assumed.
I' ve used the previous snapshot of dcmtk before and the warnings still appeared during compiling. I did not want to ignore them. Could you please give me some suggestions?
Code: Select all
#ifdef __cplusplus
#define BEGIN_EXTERN_C extern "C" {
#define END_EXTERN_C }
#else
#define BEGIN_EXTERN_C
#define END_EXTERN_C
#endif
My Last two questions are both about warnings
LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
warning C4273: 'mktemp' : inconsistent dll linkage. dllexport assumed.
I' ve used the previous snapshot of dcmtk before and the warnings still appeared during compiling. I did not want to ignore them. Could you please give me some suggestions?
-
- Posts: 61
- Joined: Wed, 2010-05-19, 09:27
- Location: Taipei, Taiwan
Re: Errors while compiling dcmtk 3.6.0 with VC++ 6.0
This warning seems harmless. It is caused originally from libxml2 while compiling in debug mode in MSVC.liuxinming wrote: LINK : warning LNK4049: locally defined symbol "_xmlFree" imported
If you really want to fix it, you have to modify some source of libmxl2 by yourself and then re-compile libxml2 with correct flags. Please see: http://msdn.microsoft.com/en-us/library/atww7hec.aspx in more detail.
This warning is caused by /MT and /MTd flags. Please check those in consistency CMake configuration.liuxinming wrote: warning C4273: 'mktemp' : inconsistent dll linkage. dllexport assumed.
Who is online
Users browsing this forum: No registered users and 1 guest