Repository: conan-io/conan-center-index

Issue:
[gdcm] gdcm/3.0.21: compilation error with openssl 1.1.1 (regression)
### Description

Recently gdcm/3.0.21 cannot be built when we use openssl 1.1.1 (all profiles: linux/windows and debug/release)

Seems to be linked to this PR: https://github.com/conan-io/conan-center-index/pull/17957

### Package and Environment Details

* Package Name/Version: ** gdcm/3.0.21**
* Operating System+version: **Linux Ubuntu 22.10**
* Compiler+version: **GCC 10**
* Conan version: **conan 1.60.1**
* Python version: **Python 3.10**


### Conan profile

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=10
compiler.libcxx=libstdc++11
build_type=Release
[options]
[conf]
[build_requires]
[env]


### Steps to reproduce

`conan new test_gdcm/1.0.0`

Edit and add:

```py
    def requirements(self):
        self.requires("gdcm/3.0.21")
        self.requires("openssl/1.1.1q")
```

`conan install --build gdcm .`

### Logs

<details><summary>Click to expand log</summary>

```
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx: In member function ‘virtual bool gdcm::OpenSSLP7CryptographicMessageSyntax::Decrypt(char*, size_t&, const char*, size_t) const’:
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx:302:3: error: ‘OpenSSL_add_all_algorithms’ was not declared in this scope
  302 |   OpenSSL_add_all_algorithms();
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLP7CryptographicMessageSyntax.cxx:406:3: error: ‘ERR_load_crypto_strings’ was not declared in this scope; did you mean ‘ERR_load_CRYPTO_strings’?
  406 |   ERR_load_crypto_strings();
      |   ^~~~~~~~~~~~~~~~~~~~~~~
      |   ERR_load_CRYPTO_strings
gmake[2]: *** [Source/Common/CMakeFiles/gdcmCommon.dir/build.make:496: Source/Common/CMakeFiles/gdcmCommon.dir/gdcmOpenSSLP7CryptographicMessageSyntax.cxx.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLCryptoFactory.cxx: In member function ‘void gdcm::OpenSSLCryptoFactory::InitOpenSSL()’:
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLCryptoFactory.cxx:27:5: error: ‘OpenSSL_add_all_algorithms’ was not declared in this scope
   27 |     OpenSSL_add_all_algorithms();
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/src/Source/Common/gdcmOpenSSLCryptoFactory.cxx:28:5: error: ‘ERR_load_crypto_strings’ was not declared in this scope; did you mean ‘ERR_load_CRYPTO_strings’?
   28 |     ERR_load_crypto_strings();
      |     ^~~~~~~~~~~~~~~~~~~~~~~
      |     ERR_load_CRYPTO_strings
gmake[2]: *** [Source/Common/CMakeFiles/gdcmCommon.dir/build.make:510: Source/Common/CMakeFiles/gdcmCommon.dir/gdcmOpenSSLCryptoFactory.cxx.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:532: Source/Common/CMakeFiles/gdcmCommon.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2
gdcm/3.0.21:
gdcm/3.0.21: ERROR: Package 'cd92cdc7d536d747cb886857fcf79c66c2ae6a16' build failed
gdcm/3.0.21: WARN: Build folder /home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/build/Release
ERROR: gdcm/3.0.21: Error in build() method, line 122
        cmake.build()
        ConanException: Error 2 while executing cmake --build "/home/florian/.conan/data/gdcm/3.0.21/_/_/build/cd92cdc7d536d747cb886857fcf79c66c2ae6a16/build/Release" '--' '-j8'
```

</details>



Discussion:

Resolving patch:
diff --git a/recipes/gdcm/all/conanfile.py b/recipes/gdcm/all/conanfile.py
--- a/recipes/gdcm/all/conanfile.py
+++ b/recipes/gdcm/all/conanfile.py
@@ -60,7 +60,7 @@ def requirements(self):
         self.requires("expat/2.5.0")
         self.requires("openjpeg/2.5.0")
         if self.options.with_zlibng:
-            self.requires("zlib-ng/2.0.7")
+            self.requires("zlib-ng/2.1.3")
         else:
             self.requires("zlib/1.2.13")
         if self.settings.os != "Windows":
@@ -68,7 +68,7 @@ def requirements(self):
             if Version(self.version) >= Version("3.0.20"):
                 self.requires("libiconv/1.17")
         if self.options.with_json:
-            self.requires("json-c/0.16")
+            self.requires("json-c/0.17")
         if self.options.with_openssl:
             self.requires("openssl/[>=1.1 <4]")
 
@@ -104,8 +104,8 @@ def generate(self):
         # https://sourceforge.net/p/gdcm/bugs/548/
         tc.preprocessor_definitions["CHARLS_NO_DEPRECATED_WARNING"] = "1"
 
-        #gdcm currently uses functionality that is deprecated since OpenSSL 3.0
-        tc.preprocessor_definitions["OPENSSL_API_COMPAT"] = "0x10101000L"
+        #gdcm currently uses functionality that is deprecated since OpenSSL 1.1.0
+        tc.preprocessor_definitions["OPENSSL_API_COMPAT"] = "0x10000000L"
 
         tc.generate()
         deps = CMakeDeps(self)


Test patch: