You may need -lc++ 
Sent from my iPad

> On Jul 30, 2025, at 14:52, Kenneth Wolcott <[email protected]> wrote:
> 
> Hi;
> 
>  What do I need to add or modify to my clang++ compile command?
> 
>  I installed gmp via MacPorts:
> 
> port installed | grep gmp | grep -v p5 | grep -v R | grep -v py
>  gmp @6.3.0_0 (active)
> 
> When I try to compile a Rosetta Code task written in C++
> 
> (https://rosettacode.org/wiki/Find_largest_left_truncatable_prime_in_a_given_base#C++)
> 
> I get these error(s):
> 
> clang++ -std=c++20 -lgmp -o
> ./find_largest_left_truncatable_prime_in_a_given_base
> ./find_largest_left_truncatable_prime_in_a_given_base.cpp
> 
> Undefined symbols for architecture arm64:
>  "operator<<(std::__1::basic_ostream<char,
> std::__1::char_traits<char>>&, __mpz_struct const*)", referenced from:
>      std::__1::basic_ostream<char, std::__1::char_traits<char>>&
> operator<<<__mpz_struct [1], __mpz_struct
> [1]>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&,
> __gmp_expr<__mpz_struct [1], __mpz_struct [1]> const&) in
> find_largest_left_truncatable_prime_in_a_given_base-ef7644.o
> ld: symbol(s) not found for architecture arm64
> clang++: error: linker command failed with exit code 1 (use -v to see
> invocation)
> 
> Thanks in advance,
> Ken Wolcott
> 

Reply via email to