Linking issue on MacOS Catalina (using XCode)

Samyukta Yagati <[email protected]>
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <[email protected]>
I installed Crypto++ from source as follows:

   1. git clone https://github.com/weidai11/cryptopp.git
   2. cd cryptopp
   3. Uncommented the CXX flag line in GNUmakefile that adds 
   "-stdlib=libc++" because I am using XCode. 
   4. make -j 8 (8 = value of $(nproc) on my machine if it were linux)
   5. sudo make install

The make and install complete without errors. I confirmed that 
/usr/local/lib contains libcryptopp.a.

When I try to use libcryptopp in a project (in a different directory from 
the cryptopp install), clang (Apple Clang 12.0.0) can't find it. I get the 
following error message:

+ LD     lib/crypto_bench
ld: library not found for -l:libcryptopp.a
clang: *error: *linker command failed with exit code 1 (use -v to see 
invocation)

This is the output of gcc --version (gcc is linked to clang but not 
directly used):

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1

Apple clang version 12.0.0 (clang-1200.0.32.29)

Target: x86_64-apple-darwin19.6.0

Thread model: posix

InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I also tried updating my PATH variable in bash_profile with the location of 
libcryptopp as follows, then source'd bash_profile again:

export PATH="/usr/local/lib:$PATH"
However, this resulted in the same error as before when I tried to compile 
the project. I've spent several hours googling and haven't been able to 
find a fix, and I'm wary of manually symlinking the file because it can 
break other installs on my laptop. Any help with fixing this issue would be 
much appreciated.

-- 
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/2c39113c-e8fd-4970-8319-70cd08aaf225n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.