Re: Linking issue on MacOS Catalina (using XCode)

Jeffrey Walton <[email protected]>
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <CAH8yC8mCGpoOq3Si5M+_6AtJ6GAuqBUn=-Dh67Q+HP5cc=EX9g@mail.gmail.com>
On Thu, Sep 16, 2021 at 6:22 PM Samyukta Yagati <[email protected]> wrote:
>
> As a follow up: I tried running
>
> >> clang++ -g2 -O3 -l /usr/local/include /usr/local/lib/libcryptopp.a -WI,-L
>
> And got the error:
> ld: library not found for -l/usr/local/include
> clang: error: linker command failed with exit code 1 (use -v to see invocation)

That's an "I" as in "include", bot a lowercase "L".

Use this command:

clang++ -g2 -O3 -I /usr/local/include test.cxx
/usr/local/lib/libcryptopp.a -o test.exe

An archive like libcryptopp.a is just a collection of object files. It
is equivalent to saying:

clang++ -g2 -O3 -I /usr/local/include test.cxx
/usr/local/lib/cryptlib.o /usr/local/lib/cpu.o
/usr/local/lib/integer.o ... -o test.exe

A share object like libcryptopp.dylib or libcryptopp.so is the same
collection of object files in an executable format that can be loaded
at runtime.

Jeff

-- 
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/CAH8yC8mCGpoOq3Si5M%2B_6AtJ6GAuqBUn%3D-Dh67Q%2BHP5cc%3DEX9g%40mail.gmail.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.