I’m writing a C++ program with XCode 15.4 and need to import the gmpxx.h file from the GNU Bignum Library. I’ve installed it on my M2 Mac using homebrew and the file is located in the directory at /opt/homebrew/include . When I run the file I get the build error:
Unknown argument: ‘-/opt/homebrew/include’
I’ve set
- Xcode settings (menu) under Locations/Custom paths to be gmpxx at /opt/homebrew/include
- Build settings for System Header Search Paths and User Header Search Paths to $gmpxx (which then uses the /opt/homebrew/include path.
- Other Linker Flags to “-lgmpxx”.
Finally, the beginning of my program is:
//
// main.cpp
// EuclideanRings2
//
// Created by Tom Hagedorn on 9/10/24.
//
#include <iostream>
#include <gmpxx.h>
….
Any ideas on what I can do to fix the “Unknown argument:” error above?
I’ve searched for others who have used gmpxx.h with Xcode. The link and search path settings above apparently work for others.