Sir
this #undef pw_gecos fix worked for me.
26 .so files are created.
Just need to know if this will have an impact on later stage and secondly if you are going to update dcmtk according to this change?
Error while building DCMTK lib for ANDROID
Moderator: Moderator Team
-
- OFFIS DICOM Team
- Posts: 318
- Joined: Mon, 2014-03-03, 09:51
- Location: Oldenburg, Germany
Re: Error while building DCMTK lib for ANDROID
Probably not, but one can't be sure. You will run into problems if you use code that depends on the define and also includes (directly or indirectly) ofstd/ofpwd.h. My guess would be that this is very unlikely, but you cannot be 100% sure.ashajg wrote:Just need to know if this will have an impact on later stage
I think I will add some code as I posted before that #undefines pw_gecos inside ofpwd.h and defines it back to pw_passwd afterwards as this should be the most robust solution.ashajg wrote:If you are going to update dcmtk according to this change?
Re: Error while building DCMTK lib for ANDROID
OK sirJan Schlamelcher wrote:Probably not, but one can't be sure. You will run into problems if you use code that depends on the define and also includes (directly or indirectly) ofstd/ofpwd.h. My guess would be that this is very unlikely, but you cannot be 100% sure.ashajg wrote:Just need to know if this will have an impact on later stage
I think I will add some code as I posted before that #undefines pw_gecos inside ofpwd.h and defines it back to pw_passwd afterwards as this should be the most robust solution.ashajg wrote:If you are going to update dcmtk according to this change?
Thank you very much for help

-
- Posts: 6
- Joined: Mon, 2020-06-22, 12:07
Re: Error while building DCMTK lib for ANDROID
sir ,Jan Schlamelcher wrote: ↑Thu, 2018-11-08, 11:53Turns out there is no good way to workaround this issue. The best way is probably to put#undef pw_gecos
in line 35 of ofstd/include/dcmtk/ofstd/ofpwd.h, but this would of course have the side effect that everyone including this file loses the definition. While this would fix the issue at hand, it might lead to problems later on. There is simply no portable way to temporary undefine a preprocessor marco and the () trick I used for working around Microsoft'smin/max
defines seems to only work on functions, but not on member variables.
Can you try it with the#undef
? If that works, I will perhaps add something like:as the least sucking solution.Code: Select all
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD #undef pw_gecos #endif ... #ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD #define pw_gecos pw_passwd #endif
I have the same problem,ndk :android-ndk-r21b,dcmtk:3.6.5,ANDROID_NATIVE_API_LEVEL:24
error log:
In file included from /mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:179:
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/ofpwd.h:87:14: error: duplicate member 'pw_passwd'
OFString pw_gecos;
^
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/ofpwd.h:84:14: note: previous declaration is here
OFString pw_passwd;
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:1179:17: warning: 'readdir_r' is deprecated: readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations]
while (!readdir_r(dirPtr, &d, &entry) && entry)
^
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/dirent.h:87:92: note: 'readdir_r' has been explicitly marked deprecated here
int readdir_r(DIR* __dir, struct dirent* __entry, struct dirent** __buffer) __attribute__((__deprecated__("readdir_r is deprecated; use readdir instead")));
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2959:3: error: multiple initializations given for non-static member 'pw_passwd'
, pw_gecos()
^~~~~~~~~~
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2958:3: note: previous initialization is here
, pw_passwd()
^~~~~~~~~~~
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2971:3: error: multiple initializations given for non-static member 'pw_passwd'
, pw_gecos()
^~~~~~~~~~
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2970:3: note: previous initialization is here
, pw_passwd()
^~~~~~~~~~~
1 warning and 3 errors generated.
ofstd/libsrc/CMakeFiles/ofstd.dir/build.make:398: recipe for target 'ofstd/libsrc/CMakeFiles/ofstd.dir/ofstd.cc.o' failed
make[2]: *** [ofstd/libsrc/CMakeFiles/ofstd.dir/ofstd.cc.o] Error 1
CMakeFiles/Makefile2:195: recipe for target 'ofstd/libsrc/CMakeFiles/ofstd.dir/all' failed
make[1]: *** [ofstd/libsrc/CMakeFiles/ofstd.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
I refer to your answer,add code in line 35 of ofstd/include/dcmtk/ofstd/ofpwd.h,
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD
#undef pw_gecos
#endif
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD
#define pw_gecos pw_passwd
#endif
but also wrong
-
- Posts: 6
- Joined: Mon, 2020-06-22, 12:07
Re: Error while building DCMTK lib for ANDROID
I solved this problemliusunping wrote: ↑Mon, 2020-06-29, 10:54sir ,Jan Schlamelcher wrote: ↑Thu, 2018-11-08, 11:53Turns out there is no good way to workaround this issue. The best way is probably to put#undef pw_gecos
in line 35 of ofstd/include/dcmtk/ofstd/ofpwd.h, but this would of course have the side effect that everyone including this file loses the definition. While this would fix the issue at hand, it might lead to problems later on. There is simply no portable way to temporary undefine a preprocessor marco and the () trick I used for working around Microsoft'smin/max
defines seems to only work on functions, but not on member variables.
Can you try it with the#undef
? If that works, I will perhaps add something like:as the least sucking solution.Code: Select all
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD #undef pw_gecos #endif ... #ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD #define pw_gecos pw_passwd #endif
I have the same problem,ndk :android-ndk-r21b,dcmtk:3.6.5,ANDROID_NATIVE_API_LEVEL:24
error log:
In file included from /mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:179:
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/ofpwd.h:87:14: error: duplicate member 'pw_passwd'
OFString pw_gecos;
^
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/include/dcmtk/ofstd/ofpwd.h:84:14: note: previous declaration is here
OFString pw_passwd;
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:1179:17: warning: 'readdir_r' is deprecated: readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations]
while (!readdir_r(dirPtr, &d, &entry) && entry)
^
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/dirent.h:87:92: note: 'readdir_r' has been explicitly marked deprecated here
int readdir_r(DIR* __dir, struct dirent* __entry, struct dirent** __buffer) __attribute__((__deprecated__("readdir_r is deprecated; use readdir instead")));
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2959:3: error: multiple initializations given for non-static member 'pw_passwd'
, pw_gecos()
^~~~~~~~~~
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2958:3: note: previous initialization is here
, pw_passwd()
^~~~~~~~~~~
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2971:3: error: multiple initializations given for non-static member 'pw_passwd'
, pw_gecos()
^~~~~~~~~~
/mnt/e/ndk/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/pwd.h:77:19: note: expanded from macro 'pw_gecos'
# define pw_gecos pw_passwd
^
/mnt/e/dicom/v7a/dcmtk-3.6.5/ofstd/libsrc/ofstd.cc:2970:3: note: previous initialization is here
, pw_passwd()
^~~~~~~~~~~
1 warning and 3 errors generated.
ofstd/libsrc/CMakeFiles/ofstd.dir/build.make:398: recipe for target 'ofstd/libsrc/CMakeFiles/ofstd.dir/ofstd.cc.o' failed
make[2]: *** [ofstd/libsrc/CMakeFiles/ofstd.dir/ofstd.cc.o] Error 1
CMakeFiles/Makefile2:195: recipe for target 'ofstd/libsrc/CMakeFiles/ofstd.dir/all' failed
make[1]: *** [ofstd/libsrc/CMakeFiles/ofstd.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
I refer to your answer,add code in line 35 of ofstd/include/dcmtk/ofstd/ofpwd.h,
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD
#undef pw_gecos
#endif
#ifdef PASSWD_GECOS_IS_DEFINED_TO_PASSWD
#define pw_gecos pw_passwd
#endif
but also wrong
add #undef pw_gecos in line 35 of ofstd/include/dcmtk/ofstd/ofpwd.h,Maybe it is due to language, I immediately mistaken your previous answer
Who is online
Users browsing this forum: No registered users and 1 guest