Ask Different (Apple)
Q&A for power users of Apple hardware and software
Latest Questions
0
votes
1
answers
97
views
gcc14 (MacPorts) cannot handle stdio.h include
I am trying to compile (from source, I am aware that there is a port but I need to compile from source) a library (GKlib) with MacPorts gcc14 on Sonoma 14.7,3. MacPorts is up to date I have set thing sup with git clone https://github.com/KarypisLab/GKlib.git cd GKlib make config cc=gcc-mp-14 prefix=...
I am trying to compile (from source, I am aware that there is a port but I need to compile from source) a library (GKlib) with MacPorts gcc14 on Sonoma 14.7,3. MacPorts is up to date
I have set thing sup with
git clone https://github.com/KarypisLab/GKlib.git
cd GKlib
make config cc=gcc-mp-14 prefix=../GKlibInstall
make
make results in:
/opt/local/bin/gcc-mp-14 -I/Users/gerben/RenskeDev/Leon/fromsource/GKlib/. -I/Users/gerben/RenskeDev/Leon/fromsource/GKlib/test -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -MD -MT CMakeFiles/GKlib.dir/b64.c.o -MF CMakeFiles/GKlib.dir/b64.c.o.d -o CMakeFiles/GKlib.dir/b64.c.o -c /Users/gerben/RenskeDev/Leon/fromsource/GKlib/b64.c
In file included from /Users/gerben/RenskeDev/Leon/fromsource/GKlib/GKlib.h:32,
from /Users/gerben/RenskeDev/Leon/fromsource/GKlib/b64.c:20:
/opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/stdio.h:83:8: error: unknown type name 'FILE'
83 | extern FILE *__stdinp;
| ^~~~
A test file (Hello World) in the directory above compiles fine. I’ve seen messages with this kind of trouble but I don’t understand exactly where this is going wrong.
gcc14 has a 'translated/fixed' stdio.h from Apple (/opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/stdio.h) that starts with:
#ifndef _STDIO_H_
#define _STDIO_H_
#include
#include
__BEGIN_DECLS
extern FILE *__stdinp;
When testing with the test file (a simple Hello World), the culprit seems to be
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
My guess is that I need to make sure make etc. add another -isysroot before the Apple SDK one. Is that correct (because then I have to find out how).
It’s been far too long I have been doing stuff like this, so I could use tips.
Thanks,
gctwnl
(762 rep)
Feb 13, 2025, 10:34 AM
• Last activity: Jul 15, 2025, 07:00 PM
1
votes
4
answers
5909
views
Issue installing GCC using homebrew (scipy package dependency)
I am attempting to install the scipy (Scientific Python, including matplotlib) package using homebrew, and I noticed that it fails when it needs to install a dependency (gcc version 4.9.0). I attempted to install it on multiple OSX versions, and even a manual method, but the error always occurs at "...
I am attempting to install the scipy (Scientific Python, including matplotlib) package using homebrew, and I noticed that it fails when it needs to install a dependency (gcc version 4.9.0).
I attempted to install it on multiple OSX versions, and even a manual method, but the error always occurs at "make bootstrap" portion.
**First method:**
brew tap Homebrew/versions brew install gcc49**Result:**
make: *** [all-multi] Error 2 make: *** [all-recursive] Error 1 make: *** [all-stage1-target-libsanitizer] Error 2 make: *** [stage-bubble] Error 2 make: *** [bootstrap] Error 2**Second Method:**
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2 gunzip gcc*.bz2 tar -xf gcc*.tar ./configure --prefix=/usr/gcc-4.9.1 --with-gmp=/usr/local/Cellar/gmp/6.0.0a --with-mpr=/usr/local/Cellar/mpfr/3.1.2-p8 --with-mpc=/usr/local/Cellar/mpc/0.26 --program-suffix=4.9.1 --enable-languages=c,c++,fortran --with-system-zlib --enable-stage1-checking --enable-plugin --enable-lto --disable-multilib**Result:** Similar output to first one at the end of output. Anyone know how to install this correctly, or do I need to use xcode? Will that even work with the scipy package installed through homebrew? **---------- UPDATE -----------** Tried suggestions. That is the "brew install gcc" and "brew install scipy" It fails at installing gcc either way, after doing those commands I get the following.
==> Installing dependencies for scipy: gcc, numpy ==> Installing scipy dependency: gcc ==> Downloading http://ftpmirror.gnu.org/gcc/gcc-4.9.1/gcc-4.9.1.tar.bz2 Already downloaded: /Library/Caches/Homebrew/gcc-4.9.1.tar.bz2 ==> ../configure --build=x86_64-apple-darwin14.0.0 --prefix=/usr/local/Cellar/gcc/4.9.1 --enable-languages=c,c++,objc,obj-c++,fortran - ==> make bootstrap mkdir common mkdir common/.deps config.status: executing default commands make: *** [stage2-bubble] Error 2 make: *** [bootstrap] Error 2 READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting These open issues may also help: gcc: compatibility 10.10 (https://github.com/Homebrew/homebrew/pull/31466) gcc 4.8.3 bottle has invalid omp.h header (https://github.com/Homebrew/homebrew/issues/29670) MacOS.(gcc|clang|llvm)_version can return nil (https://github.com/Homebrew/homebrew/issues/18781)
npderi
(19 rep)
Aug 17, 2014, 09:54 PM
• Last activity: Mar 14, 2025, 02:29 PM
1
votes
1
answers
247
views
g++ fails after 13.4 -> 13.6.1 update
I updated from 13.4 to 13.6.1 and reinstalled Xcode. I have installed gcc (which I believe includes g++) using Homebrew, and have made sure my Homebrew installation is up to date. When I `g++ foo.cpp`, which used to compile and link cleanly, I now get ld: warning: ignoring duplicate libraries: '-lgc...
I updated from 13.4 to 13.6.1 and reinstalled Xcode. I have installed gcc (which I believe includes g++) using Homebrew, and have made sure my Homebrew installation is up to date. When I
g++ foo.cpp
, which used to compile and link cleanly, I now get
ld: warning: ignoring duplicate libraries: '-lgcc'
0 0x1023ef648 __assert_rtn + 72
1 0x102323fac ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204
2 0x102339924 ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164
3 0x102346e30 ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420
4 0x196db0440 _dispatch_client_callout2 + 20
5 0x196dc3f1c _dispatch_apply_invoke + 224
6 0x196db0400 _dispatch_client_callout + 20
7 0x196dc1fb8 _dispatch_root_queue_drain + 684
8 0x196dc26c0 _dispatch_worker_thread2 + 164
9 0x196f5c038 _pthread_wqthread + 228
ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
collect2: error: ld returned 1 exit status
I have no idea what is going on and also have no idea how to figure it out.
rogerl
(193 rep)
Nov 12, 2023, 02:28 PM
• Last activity: Apr 11, 2024, 01:03 AM
12
votes
4
answers
28719
views
Can't install NTFS-3G on macOS BigSur
Hi I'm trying to install NTFS-3G on macOS BigSur but every time I run `brew install ntfs-3g` it reports `Error: ntfs-3g has been disabled because it requires FUSE!`. Obviously I've already installed macFUSE from osxfuse but brew doesn't seem to recognise it. How can I solve that?
Hi I'm trying to install NTFS-3G on macOS BigSur but every time I run
brew install ntfs-3g
it reports Error: ntfs-3g has been disabled because it requires FUSE!
.
Obviously I've already installed macFUSE from osxfuse but brew doesn't seem to recognise it.
How can I solve that?
Matteo
(121 rep)
Jun 16, 2021, 08:28 AM
• Last activity: Mar 13, 2024, 06:24 PM
0
votes
1
answers
84
views
XFCE Build Error xdt-csource.1
I'm trying to build xfce4-dev-tools on macOS Monetary. to build and install xfce4 desktop environment. im a total noob when it comes to building c/c++ programs. Following the steps - 1. cloned the repo, 2. added the dependencies noted by xfce.org 3. added them to the path. 4. ran `./autogen.sh` as m...
I'm trying to build xfce4-dev-tools on macOS Monetary. to build and install xfce4 desktop environment. im a total noob when it comes to building c/c++ programs.
Following the steps -
1. cloned the repo,
2. added the dependencies noted by xfce.org
3. added them to the path.
4. ran
./autogen.sh
as mentioned (no error)
5. ran make
bash-3.2$ make
Making all in docs
xsltproc --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl xdt-csource.xml
I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl "
cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
make: *** [xdt-csource.1] Error 4
make: *** [all-recursive] Error 1
what I found out was that linux-doctools
is missing and I'm quite lost on an alternative to this lib.
also don’t ask me why I'm trying to install a DE on macOS. this should be possible as XFCE should work on nix platforms.
janithcooray
(111 rep)
Jul 29, 2023, 06:12 AM
• Last activity: Dec 26, 2023, 11:07 AM
1
votes
1
answers
265
views
'clang' vs. 'gcc' vs. 'cpp' Binaries
On MacOS 14.2, typing either '`clang --version`' or '`gcc --version`' (or even '`cpp --version`') returns the same: Apple clang version 15.0.0 (clang-1500.1.0.2.5) Target: arm64-apple-darwin23.2.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xc...
On MacOS 14.2, typing either '
clang --version
' or 'gcc --version
' (or even 'cpp --version
') returns the same:
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: arm64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
What is the difference between cpp
, gcc
, clang
? 'ls -la /usr/bin
' tells me at least none of them are symlinks.
shea
(315 rep)
Dec 22, 2023, 11:49 AM
• Last activity: Dec 23, 2023, 10:48 PM
0
votes
0
answers
279
views
Error installing gcc-devel on macOS Sonoma
I am facing installing gcc-devel on my MacBook macOS Sonoma with macport. I am getting following error messages: ``` Continue? [Y/n]: Y Portfile changed since last build; discarding previous state. ---> Fetching archive for libgcc-devel ---> Attempting to fetch libgcc-devel-14-20231001_1+stdlib_flag...
I am facing installing gcc-devel on my MacBook macOS Sonoma with macport. I am getting following error messages:
Continue? [Y/n]: Y
Portfile changed since last build; discarding previous state.
---> Fetching archive for libgcc-devel
---> Attempting to fetch libgcc-devel-14-20231001_1+stdlib_flag.darwin_23.x86_64.tbz2 from https://packages.macports.org/libgcc-devel
---> Attempting to fetch libgcc-devel-14-20231001_1+stdlib_flag.darwin_23.x86_64.tbz2 from http://jog.id.packages.macports.org/macports/packages/libgcc-devel
---> Attempting to fetch libgcc-devel-14-20231001_1+stdlib_flag.darwin_23.x86_64.tbz2 from https://nue.de.packages.macports.org/libgcc-devel
---> Fetching distfiles for libgcc-devel
---> Verifying checksums for libgcc-devel
---> Extracting libgcc-devel
---> Applying patches to libgcc-devel
---> Configuring libgcc-devel
---> Building libgcc-devel
Error: Failed to build libgcc-devel: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc-devel/libgcc-devel/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there
is a bug.
Error: Processing of port gcc-devel failed
ramchand@Rams-MacBook-Pro ~ %
user6737063
(1 rep)
Dec 10, 2023, 01:49 PM
• Last activity: Dec 10, 2023, 02:34 PM
2
votes
0
answers
177
views
Is GNU assembler bundled with GCC provided by Homebrew?
I'm on Intel Mac running the latest Monterey. Already have [GCC 13][1] installed using Homebrew. I'm trying to build [sectorlisp][2]. Unfortunately still fails, because **as** (the LLVM assembler) rejected it. Perhaps there are some incompatibilities. So I setup a Debian VM, installed GCC etc, and s...
I'm on Intel Mac running the latest Monterey. Already have GCC 13 installed using Homebrew.
I'm trying to build sectorlisp .
Unfortunately still fails, because **as** (the LLVM assembler) rejected it. Perhaps there are some incompatibilities. So I setup a Debian VM, installed GCC etc, and succesfully built it. Hmm.
I couldn't fine **as** executable in
/usr/local/Cellar/gcc/13.2.0/bin
. Perhaps there's an easy way to install GNU assembler on macOS?
anta40
(279 rep)
Nov 6, 2023, 02:21 PM
• Last activity: Nov 6, 2023, 04:10 PM
7
votes
4
answers
7772
views
Unable to find include file on newly updated macOS(C/C++)
I have used the g++ command on the terminal to compile C++ programs but all of a sudden, after an update to my Mac's OS (to macOS 13.3 Ventura,), I started receiving the message: againtest.c:6:10: fatal error: stdio.h: No such file or directory #include ^~~~~~~~~ compilation terminated. Then I reins...
I have used the g++ command on the terminal to compile C++ programs but all of a sudden, after an update to my Mac's OS (to macOS 13.3 Ventura,), I started receiving the message:
againtest.c:6:10: fatal error: stdio.h: No such file or directory
#include
^~~~~~~~~
compilation terminated.
Then I reinstalled Xcode by
Xcode-select --install
, trying to reset the environment -- nothing works and I reinstalled command line tools and that did not solve the problem that include file is missing.
Later I tried to make it work by:
export CPATH='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platf>
export LIBRARY_PATH='/Applications/Xcode.app/Contents/Developer/Platforms/MacOS>
My Clion works well but on terminal, it still doesn't work.
If I attempt to compile a simple program like that:
#include
using namespace std;
int main() {
int a = 0;
while(a++ struct __is_nullptr_t_impl : public true_type {};
^
In file included from while.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iostream:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ios:221:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:45: error: field has incomplete type 'std::exception_ptr'
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:144:24: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_TYPE_VIS exception_ptr
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:5: error: '__abi_tag__' attribute only applies to structs, variables, functions, and namespaces
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:689:37: note: expanded from macro '_LIBCPP_INLINE_VISIBILITY'
# define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__config:673:26: note: expanded from macro '_LIBCPP_HIDE_FROM_ABI'
__attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
^
In file included from while.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iostream:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ios:221:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:848:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/allocator.h:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/new:94:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/exception:149:55: error: expected ';' at end of declaration list
_LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
^
In file included from while.cpp:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/iostream:41:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/ios:221:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__locale:18:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:860:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/shared_ptr.h:28:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:173:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:262:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:32: error: member 'nullptr_t' declared as a template
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:395:42: error: expected ';' at end of declaration list
_LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT : __ptr_(__value_init_tag(), __value_init_tag()) {}
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:484:25: error: unknown type name 'nullptr_t'
unique_ptr& operator=(nullptr_t) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:14: error: unknown type name 'nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:24: error: cannot initialize a parameter of type 'int' with an rvalue of type 'std::nullptr_t'
void reset(nullptr_t = nullptr) _NOEXCEPT {
^ ~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:533:24: note: passing argument to parameter here
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:594:45: error: unknown type name 'nullptr_t'
operator==(const unique_ptr& __x, nullptr_t) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:602:12: error: unknown type name 'nullptr_t'
operator==(nullptr_t, const unique_ptr& __x) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:610:45: error: unknown type name 'nullptr_t'
operator!=(const unique_ptr& __x, nullptr_t) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:618:12: error: unknown type name 'nullptr_t'
operator!=(nullptr_t, const unique_ptr& __x) _NOEXCEPT
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:626:44: error: unknown type name 'nullptr_t'
operator& __x, nullptr_t)
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/unique_ptr.h:635:11: error: unknown type name 'nullptr_t'
operator& __x)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Would like some help on this.
baseptr256
(71 rep)
Apr 4, 2023, 07:27 AM
• Last activity: Aug 6, 2023, 12:33 PM
1
votes
0
answers
52
views
Segfaults for both gcc-13 and clang on Apple Silicon
I just upgraded to an Apple Silicon (M2) box, and both gcc-13 (installed via HomeBrew) and clang produce segfaults on just about anything. I don't know how to debug that and figure out what is going wrong. Since they both segfault, I'm guessing it's something obvious.
I just upgraded to an Apple Silicon (M2) box, and both gcc-13 (installed via HomeBrew) and clang produce segfaults on just about anything. I don't know how to debug that and figure out what is going wrong. Since they both segfault, I'm guessing it's something obvious.
rogerl
(193 rep)
Jun 14, 2023, 07:37 PM
1
votes
0
answers
83
views
g++ setting proper @rpath when building SFML
I'm trying to build an SFML sample without xcode (for reasons :-)). The prebuilt samples comes with: ``` pong> otool -L pong pong: @rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio (compatibility version 2.5.0, current version 2.5.1) @rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics (c...
I'm trying to build an SFML sample without xcode (for reasons :-)).
The prebuilt samples comes with:
pong> otool -L pong
pong:
@rpath/sfml-audio.framework/Versions/2.5.1/sfml-audio (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-graphics.framework/Versions/2.5.1/sfml-graphics (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-window.framework/Versions/2.5.1/sfml-window (compatibility version 2.5.0, current version 2.5.1)
@rpath/sfml-system.framework/Versions/2.5.1/sfml-system (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 19.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
When I build it myself (build command follows), I rather obtain:
pong> otool -L a.out
a.out:
@rpath/libsfml-system.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-window.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-graphics.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
@rpath/libsfml-audio.2.5.dylib (compatibility version 2.5.0, current version 2.5.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
This prevents my built version from running, as it fails to load the library. How would I tell g++
to generate the same @rpath
s as those prebuilt?
The build command I used is:
g++ Pong.cpp -I ../../include -L ../../lib/ -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
In case this makes any difference, this is on Ventura.
Jeffrey
(111 rep)
Mar 25, 2023, 06:49 PM
• Last activity: Mar 25, 2023, 08:33 PM
5
votes
1
answers
3031
views
assert.h not found when including bits/stdc++.h
Yesterday I upgraded my Command Line Tools to version 14.2, and my macOS version to Ventura 13.1. When I tried to include `bits/stdc++.h` inside a C++ file and compile it, it gave me this error: ``` fatal error: assert.h: No such file or directory 44 | #include | ^~~~~~~~~~ ``` The error clearly see...
Yesterday I upgraded my Command Line Tools to version 14.2, and my macOS version to Ventura 13.1.
When I tried to include
bits/stdc++.h
inside a C++ file and compile it, it gave me this error:
fatal error: assert.h: No such file or directory
44 | #include
| ^~~~~~~~~~
The error clearly seems to originate from the missing assert.h
file (along with some others, such as ctype.h
).
I checked my /usr/include
directory, and it does appear that the assert.h file does not exist.
I am using g++12 which I installed from homebrew. I tried reinstalling g++ and command line tools, but that did not help. Also, before upgrading my command line tools, everything worked fine. What can I do to fix this?
J Muzhen
(191 rep)
Dec 24, 2022, 02:00 AM
• Last activity: Dec 24, 2022, 03:44 AM
1
votes
2
answers
5727
views
Downgrade GCC version
How do I downgrade my GCC v5 to GCC version 4.7 ? I currently don't have Xcode installed and I am using the command line tool. More details : Apple LLVM version 7.3.0 (clang-703.0.29) Target: x86_64-apple-darwin15.4.0 Thread model: posix OS X Version : 10.11.4
How do I downgrade my GCC v5 to GCC version 4.7 ? I currently don't have Xcode installed and I am using the command line tool.
More details :
Apple LLVM version 7.3.0 (clang-703.0.29)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
OS X Version : 10.11.4
Sentient07
(193 rep)
May 25, 2016, 07:00 PM
• Last activity: Nov 23, 2022, 07:59 PM
36
votes
5
answers
171374
views
How to set gcc 4.8 as default gcc compiler
I recently installed `gcc 4.8` using `brew` on `OSX 10.7.5 (Lion)`. I can now compile using `gcc 4.8` by using g++-4.8 some_file.c or using the default `gcc 4.2` by using g++ some_file.c I want to use `gcc 4.8` as the default compiler for `Xcode` and if I type `gcc` at the terminal. I suppose I must...
I recently installed
gcc 4.8
using brew
on OSX 10.7.5 (Lion)
. I can now compile using gcc 4.8
by using
g++-4.8 some_file.c
or using the default gcc 4.2
by using
g++ some_file.c
I want to use gcc 4.8
as the default compiler for Xcode
and if I type gcc
at the terminal. I suppose I must alter gcc-related
links within dirname $(which gcc)
.
When I do
ls -al $(dirname $(which gcc)) | grep 'gcc\|g++\|c++'
I get the following:
lrwxr-xr-x 1 root wheel 7 Jul 31 12:17 c++ -> clang++
-rwxr-xr-x 1 root wheel 909360 Nov 18 2011 c++filt
lrwxr-xr-x 1 root wheel 5 Jul 31 12:17 clang++ -> clang
lrwxr-xr-x 1 root wheel 12 Jul 31 12:17 g++ -> llvm-g++-4.2
lrwxr-xr-x 1 root wheel 12 Jul 31 12:17 gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 28 Jul 31 12:17 gcov-4.2 -> ../llvm-gcc-4.2/bin/gcov-4.2
lrwxr-xr-x 1 root wheel 52 Jul 31 12:17 i686-apple-darwin11-llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-g++-4.2
lrwxr-xr-x 1 root wheel 52 Jul 31 12:17 i686-apple-darwin11-llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/i686-apple-darwin11-llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-cpp-4.2 -> ../llvm-gcc-4.2/bin/llvm-cpp-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-g++ -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-gcc -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Jul 31 12:17 llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
When I run: which gcc-4.8
I get /usr/local/bin/gcc-4.8
.
Steps to get this done would be very helpful.
Please and thank you.
quine
(783 rep)
Aug 16, 2013, 04:11 AM
• Last activity: Nov 21, 2022, 06:45 AM
0
votes
1
answers
1067
views
GCC 4.7 (via brew) keeps including from "/usr/include/c++/4.2.1"
This one is driving me crazy: I need to use lot of stuff which simply does not compile with the standard clang/llvm compilers which come with Xcode 5 (on Mac OS X 10.8), so I decided to install gcc47 via brew. Everything went fine but when I try to compile things, I get several error messages and I...
This one is driving me crazy:
I need to use lot of stuff which simply does not compile with the standard clang/llvm compilers which come with Xcode 5 (on Mac OS X 10.8), so I decided to install gcc47 via brew.
Everything went fine but when I try to compile things, I get several error messages and I discovered that some includes are still coming from "/usr/include/c++/4.2.1", which is really weird.
Can anyone explain me how to set it up in a clean way?
These are the step I was doing:
- brew update
- brew install gcc47
- alias gcc='gcc-4.7'
brew warned me that I have to set up
LDFLAGS
and CPPFLAGS
, quoting (summarised):
> This formulas are keg-only: so they were not symlinked into /usr/local.
Conflicts with gmp, mpfr, libmpc, ppl in main repository.
Generally there are no consequences of this for you. If you build your
own software and it requires these formulas, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/gmp4/lib
CPPFLAGS: -I/usr/local/opt/gmp4/include
LDFLAGS: -L/usr/local/opt/mpfr2/lib
CPPFLAGS: -I/usr/local/opt/mpfr2/include
LDFLAGS: -L/usr/local/opt/libmpc08/lib
CPPFLAGS: -I/usr/local/opt/libmpc08/include
LDFLAGS: -L/usr/local/opt/ppl011/lib
CPPFLAGS: -I/usr/local/opt/ppl011/include
LDFLAGS: -L/usr/local/opt/cloog-ppl015/lib
CPPFLAGS: -I/usr/local/opt/cloog-ppl015/include
So exporting LDFLAGS
and CPPFLAGS
via
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/gmp4/lib -L/usr/local/opt/mpfr2/lib -L/usr/local/opt/libmpc08/lib -L/usr/local/opt/ppl011/lib -L/usr/local/opt/cloog-ppl015/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/gmp4/include -I/usr/local/opt/mpfr2/include -I/usr/local/opt/libmpc08/include -I/usr/local/opt/ppl011/include -I/usr/local/opt/cloog-ppl015/include"
should do the trick (I thought).
But it doesn't. I keep getting messages like:
> /usr/include/c++/4.2.1/bits/stl_vector.h:600:7: note: must qualify
> identifier to find this declaration in dependent base class
> push_back(const value_type& __x)
> ^
and I simply don't understand why?
tamasgal
(91 rep)
Nov 27, 2013, 03:48 PM
• Last activity: Nov 19, 2022, 11:35 AM
4
votes
2
answers
16894
views
How to get the default compiler of C++ on Mac OS X
I am new to C++ on Mac OS X, and I need to know how to get some details: 1. How can I get the default compiler for C++ and C? 2. How can I change the default compiler? 3. How can I set the compiler in a [CMakeLists.txt][1] file when using [CMake][2]? [1]: https://cmake.org/cmake/help/latest/manual/c...
I am new to C++ on Mac OS X, and I need to know how to get some details:
1. How can I get the default compiler for C++ and C?
2. How can I change the default compiler?
3. How can I set the compiler in a CMakeLists.txt file when using CMake ?
BetterEnglish
(141 rep)
Dec 11, 2015, 10:58 PM
• Last activity: Nov 9, 2022, 04:04 AM
60
votes
6
answers
139237
views
How to accept Xcode license?
I want to install a C based toolbox on MATLAB software. To do this, I need to install the GCC compiler. I think I have done that already. And I have Xcode too. To setup the toolbox, I need to write `mex -setup;` in the MATLAB command window. I've got the following warning and don't know how to solve...
I want to install a C based toolbox on MATLAB software. To do this, I need to install the GCC compiler. I think I have done that already. And I have Xcode too.
To setup the toolbox, I need to write
mex -setup;
in the MATLAB command window. I've got the following warning and don't know how to solve it:
> Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
>
> Error using mex
> No supported compiler or SDK was found. For options, visit http://www.mathworks.com/support/compilers/R2014a/maci64 .
SAH
(798 rep)
Mar 2, 2015, 04:21 PM
• Last activity: Sep 16, 2022, 09:04 AM
1
votes
2
answers
3253
views
Where are g++ stl libraries in Darwin
I am trying to understand how some of the data structures are designed in stl. In ubuntu, I usually open the .h and .cpp files from /usr/local/include but in Darwin (kernel version 14.3.0) I am lost, google doesnt help much either, the file structure is different. So, could you please tell me where...
I am trying to understand how some of the data structures are designed in stl. In ubuntu, I usually open the .h and .cpp files from /usr/local/include but in Darwin (kernel version 14.3.0) I am lost, google doesnt help much either, the file structure is different. So, could you please tell me where are those libraries' .h and .cpp files in mac?
P.S. I installed XCode but I didnt like it so I uninstalled it. The g++ stayed even after uninstall. Actually I never tried checking whether g++ was there before I installed Xcode. I dont have /Applications/Xcode.app so it must be someplace else.
Shankhoneer Chakrovarty
(121 rep)
Jun 17, 2015, 04:30 PM
• Last activity: Jul 30, 2022, 12:41 PM
0
votes
0
answers
1048
views
Error installing gcc 7 on a MacBook
I have Mac OS 11.2.3 (the new MacBook Air) I am trying to install gcc version 7 using the command: brew install gcc@7 However, I get the following error: gcc@7: The x86_64 architecture is required for this software. Error: An unsatisfied requirement failed this build. What does this mean? How to res...
I have Mac OS 11.2.3 (the new MacBook Air) I am trying to install gcc version 7 using the command:
brew install gcc@7
However, I get the following error:
gcc@7: The x86_64 architecture is required for this software.
Error: An unsatisfied requirement failed this build.
What does this mean? How to resolve this problem?
dbrane
(151 rep)
Jul 10, 2021, 12:21 AM
• Last activity: May 23, 2022, 08:35 PM
3
votes
2
answers
2190
views
How can I point gcc and g++ to the gnu compiler collection?
I want to use the gnu compiler collection instead of the x-code compiler to compile some bioinformatics tools on the mac, which did compile on Linux but fails to build on macOS. I did install homebrew $ brew install gcc $ cd /usr/local/bin $ sudo ln -s /opt/homebrew/bin/gcc-11 gcc $ /usr/local/bin/g...
I want to use the gnu compiler collection instead of the x-code compiler to compile some bioinformatics tools on the mac, which did compile on Linux but fails to build on macOS.
I did install homebrew
$ brew install gcc
$ cd /usr/local/bin
$ sudo ln -s /opt/homebrew/bin/gcc-11 gcc
$ /usr/local/bin/gcc
gcc: fatal error: no input files
$ which gcc
/usr/local/bin/gcc
However, calling gcc without the path still points to clang.
$ gcc
clang: error: no input files
How can I point gcc and g++ to the gnu compiler collection?
witek
(131 rep)
Jan 26, 2022, 08:59 PM
• Last activity: Mar 26, 2022, 02:42 PM
Showing page 1 of 20 total questions