Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMD 2.101.2 Linker Failure: undefined reference to `EVP_PKEY_id' #3

Open
vnayar opened this issue Jan 7, 2023 · 1 comment
Open

Comments

@vnayar
Copy link

vnayar commented Jan 7, 2023

When building in a Linux environment (Ubuntu 22.04) using DMD 2.101.2, the following linker error occurs:

$ dub test
             Generating test runner configuration 'hunt-jwt-test-library' for 'library' (library).
    Starting Performing "unittest" build using /usr/bin/dmd for x86_64.
  Up-to-date hunt-openssl 1.0.5: target for configuration [library] is up to date.
    Building hunt-jwt 0.2.0-beta.4: building configuration [hunt-jwt-test-library]
     Linking hunt-jwt-test-library
/usr/bin/ld: .dub/build/hunt-jwt-test-library-unittest-linux.posix-x86_64-dmd_v2.101.2-343692FFC124CA6A1923313B445FB1A29395AAB2874DF58055DC13E81D95754D/hunt-jwt-test-library.o: in function `_D4hunt3jwt10JwtOpenSSL10signShaPemFPxS6deimos7openssl3evp9env_md_stiAyaQdZAh':
/home/vnayar/src/hunt-jwt/source/hunt/jwt/JwtOpenSSL.d:126: undefined reference to `EVP_PKEY_id'
/usr/bin/ld: .dub/build/hunt-jwt-test-library-unittest-linux.posix-x86_64-dmd_v2.101.2-343692FFC124CA6A1923313B445FB1A29395AAB2874DF58055DC13E81D95754D/hunt-jwt-test-library.o: in function `_D4hunt3jwt10JwtOpenSSL12verifyShaPemFPxS6deimos7openssl3evp9env_md_stiAyaAxhQgZb':
/home/vnayar/src/hunt-jwt/source/hunt/jwt/JwtOpenSSL.d:348: undefined reference to `EVP_PKEY_id'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
Error /usr/bin/dmd failed with exit code 1.
@vnayar
Copy link
Author

vnayar commented Jan 7, 2023

Apparently, the problem stems from a renaming of symbols that has occurred since OpenSSL 3.0: https://www.openssl.org/docs/man3.0/man3/EVP_PKEY_id.html

EVP_PKEY_id is now named EVP_PKEY_get_id, however, this is only known at link time rather than compile time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant