XCode and gcc errors - xcode

So, I feel like my xcode/gcc/however they are supposed to work together has been broken for a while. Trying to download various technologies (most recently redis) has always ended in sadness. When I tried to make the redis I get
-bash-3.2$ make
cd src && make all
LINK redis-server
/bin/sh: gcc-4.6: command not found
make[1]: *** [redis-server] Error 127
make: *** [all] Error 2
This is the kind of error I've been gettng forever. For reference, I'm running Mac 10.7.5, my latest xcode is 4.6 and my latest gcc is 4.2. Any ideas on how I can make this work? I'd rather not upgrade my Mac OS if possible. Thanks!

I honestly don't know if this is the right way to fix this, but this issue became so problematic for me that I was willing to try anything. I noticed that I definitely had a
/usr/bin/gcc
file. And I notice that my system couldn't find the /gcc-4.6.
So.... I just did one of these numbers
sudo cp /usr/bin/gcc /usr/bin/gcc-4.6
and voila. It works now. Now I can do it all, including essential tasks like compiling any C code. So, hopefully this helps someone out.

Related

I can't install ffmpegs (dependencies) - error with doxygen [mac 10.12.6 Sierra]

It installed about 70% of the dependencies it needed to get ffmpegs going, but it got stuck at installing 'doxygen'.
This is the error I got:
==> Installing dependencies for ffmpeg: doxygen, little-cms2, openjpeg, opus, rust, libgit2, cargo-c, rav1e, flac, libsndfile, libsamplerate, rubberband, sdl2, swig, llvm, snappy, speex, srt, leptonica, libb2, lz4, libarchive, tesseract, theora, x264, x265, xvid, docbook, boost, source-highlight, asciidoc, docbook-xsl, libyaml, ruby, asciidoctor, gnu-getopt, xmlto, libsodium, zeromq and zimg
==> Installing ffmpeg dependency: doxygen
==> cmake ..
==> make
Last 15 lines from /Users/macbook/Library/Logs/Homebrew/doxygen/02.make:
In file included from /tmp/doxygen-20220723-61533-5m5mdv/doxygen-1.9.4/src/outputlist.h:25:
/tmp/doxygen-20220723-61533-5m5mdv/doxygen-1.9.4/src/searchindex.h:29:10: fatal error: 'variant' file not found
#include <variant>
^~~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/doxymain.dir/__/generated_src/code.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/doxymain.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 46%] Linking CXX static library ../lib/libvhdlparser.a
cd /tmp/doxygen-20220723-61533-5m5mdv/doxygen-1.9.4/build/vhdlparser && /usr/local/Cellar/cmake/3.23.2/bin/cmake -P CMakeFiles/vhdlparser.dir/cmake_clean_target.cmake
cd /tmp/doxygen-20220723-61533-5m5mdv/doxygen-1.9.4/build/vhdlparser && /usr/local/Cellar/cmake/3.23.2/bin/cmake -E cmake_link_script CMakeFiles/vhdlparser.dir/link.txt --verbose=1
/usr/bin/ar qc ../lib/libvhdlparser.a CMakeFiles/vhdlparser.dir/CharStream.cc.o CMakeFiles/vhdlparser.dir/ParseException.cc.o CMakeFiles/vhdlparser.dir/Token.cc.o CMakeFiles/vhdlparser.dir/TokenMgrError.cc.o CMakeFiles/vhdlparser.dir/__/generated_src/VhdlParser_adj.cc.o CMakeFiles/vhdlparser.dir/VhdlParserTokenManager.cc.o
/usr/bin/ranlib ../lib/libvhdlparser.a
[ 46%] Built target vhdlparser
make: *** [all] Error 2
Do not report this issue to Homebrew/brew or Homebrew/core!
Error: You are using macOS 10.12.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.
Can someone please help me am not sure what it is, that I am supposed to do.
Looks like we're in the same boat. Fighting the "good fight", as it were. We should probably both just bail to linux or even windows, because god knows they are going to keep making this hard for us....
However, probably like yourself, a combination of inertia and "good reasons" keeps us staying the course ;)
Basically, the issue is described correctly by the others here (lack of c++ 17 support) and in my case (and likely yours as well) is because gcc is a symlink to clang (9.0 if you are using the latest version compatible with our os)
Telling brew to use real gcc (I assume you have compiled it already, and if not - gcc 11.3.0 is a dependency for ffmpeg anyhow, so go ahead and build it; brew install gcc) can be done like this :
HOMEBREW_CC=gcc-11 HOMEBREW_CXX=g++-11 brew install doxygen
However, the above didn't work for me because - although it solved the c++ 17 issue, it exposed another problem :(
It seems that for some reason the minimum macos version number is messed up (I think because the sdk headers for 10.13 are installed with the latest version of xcode compatible with our os) and so the compilation fails. Although there is almost certainly a better/cleaner way to deal with this issue, I solved it by manually compiling and installing doxygen after editing the code.
In the doxygen/filesystem/filesystem.hpp file around line 4491 you need to change the line
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
to
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 111400
Then compile doxygen (extract the source from the brew cache), cd to the cmake folder then run
cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/doxygen/1.9.4 -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTING=OFF -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11
make
make install
brew link doxygen
Then continue the brew install ffmpeg. I had trouble with nettle as well, and needed to compile and install that one manually too because the version of libcrypto packaged with macos (libressl) is incompatible. I had to do the steps shown in "brew info openssl#1.1" in order to make sure the compiler used the openssl libcrypto that IS compatible and I couldn't figure out how to make brew do this for me.
Fun fun fun. I am not all that hopeful that the rest of the compilation will go without issue, but it is chugging away again now. I get the distinct impression that this is SO not worth the hassle/trouble.
Good luck!
** EDIT **
I'm still slogging through it, and it is taking a LONG time. But as I encounter more issues I will try and detail them here with the hope that each issue I encounter is reasonably easy to overcome.
llvm failed to compile with lots of missing header errors. Directing brew to use gcc-11 like i did with doxygen worked to compile it further (27%) but still failed (it looks like because it is calling clang specific options as a result of the brew cmake config passed to it... i'm still working on this one...)
Conclusion - I gave up. It isn't worth the time in my view.
Instead I installed macports and used "sudo port install ffmpeg-upstream" to install ffmpeg-5. Unless you have some dying need to compile yourself, I recommend you do this as well.
I've spent quite some time to get around this issue as well and I ended up with another solution. I merely edited the formula to suit my needs :
brew edit doxygen
Once there, spot the "def install" block then edit the file so that it looks like this :
fails_with :clang
def install
inreplace "CMakeLists.txt", "MACOS_VERSION_MIN 10.14", "MACOS_VERSION_MIN 10.11"
Save, exit.
In short, just add the "fails_with" line and the "inreplace" line. The first one causes brew to not use clang (so you need to have a gcc copy somewhere). This is to solve the C++17 issue. The second one patches the CMakeLists.txt file to allows cmake to do its magic. Once done, "brew install doxygen" should succeed.

Error installing libmaxminddb

I am trying to install the GEolite2 database on a netbsd server. I can't get past the first make for libmaxmindb. I get the following error;
make all-recursive
Making all in src
Making all in bin
Making all in t
make: don't know how to make man/man1/*.1. Stop
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
*** Error code 1
Stop.
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
*** Error code 1
Stop.
make: stopped in /usr/local/maxmind/libmaxminddb-1.1.1
Hpw can I either fix this or get around it?
UPDATE:
I downloaded the tarball for 1.1.1 from github.com/maxmind/libmaxminddb/releases/download/1.1.1/….
I noticed that the man directory has no Makefile in it and from what I could tell, maybe it should.
I am using NetBSD 6.0.1 and ran the steps in the Readme.
configure - ran normally
make - failed as shown above. –
I also tried starting from a git clone - same result.
On BSD systems one should always use GNU Make with Makefiles generated by GNU Automake.
I see in README.md for the libmaxminddb repository on github.com that one is expected to run the bootstrap script after cloning the repo (which is quite normal, though more often the script is called autogen).
If you don't already have GNU Make and the GNU Autotools installed I recommend using pkgsrc to install them.

xcode/perlbrew & building CPAN modules - make options? SDKs? Getting build errors

I'm brand new to OSX, but have been using UNIX/Linux for decades. Just got a new MBP Retina running latest OSX 10.8.1.
installed fink
installed perlbrew
installed xcode
All's well, except I can't get a lot of CPAN modules to build. I am guessing I need to add some magic xcode SDK to get needed libs?
Here's an example:
$ cpanm Wx
...
make[2]: *** No rule to make target `/Users/dfelicia/perl5/perlbrew/perls/perl-5.16.1/lib/5.16.1/darwin-thread-multi-2level/CORE/cc_runtime.h', needed by `RichText.o'.
Stop.
make[1]: *** [subdirs] Error 2
make: *** [subdirs] Error 2
Regardless of the module that fails to build (and there are many), the failure is always with cc_runtime.h.
What am I missing?
I built perl 5.16.2 using the perlbrew arguments from here: http://wiki.wxperl.info/w/index.php/Mac_OS_X_Platform_Notes
Ah ha. I figured out that fink was injecting its perl into the shell env (PERL5LIB, PERLHOME, #INC, etc.). How annoying. I ditched fink and am using Mac Ports, instead.
Anyhow, with a clean env I am able to build everything.
Guesswork on my side as I've never really gotten into OSX:
Have you tried installing MakeMaker as suggested here? Sounds like it could make sense if you have a lot of failures.
CPAN should do that for you though...

Help using Simple Vector Library (SVL) with Xcode

I am writing a small program using openGl and SDL. I need to use SVL for various reasons but I cannot get it to link up properly in Xcode. Has anyone done this before and could talk me through it? I followed the readme from SVL and get the following when I run make install:
ip-156-133:svl-1.5 2 Tom$ sudo make install
installing into /usr/local/include/svl /usr/local/doc
done.
installing into /usr/local/lib /usr/local/include
chmod: lib/*: No such file or directory
make: [install-libs] Error 1 (ignored)
cp: lib/*: No such file or directory
make: [install-libs] Error 1 (ignored)
done.
Could be this be part of the problem?
Also I'm not sure where to add the -lsvl flag and -lsvl.dbg etc.
Any help would be greatly appreciated.
Thanks
SVL seems rather unmaintained, given that the latest version is nearly eight years old.
I'd recommend Eigen, which is under active development and has the added benefit of being a header-only library.

Trouble installing/compiling lua on macosx

I have been attempting to compile/install Lua on Snow Leopard. I have changed the target platform in the Makefile.std to macosx and I still get the following issue:
sudo make -f Makefile.std macosx
make[1]: *** No rule to make target 'macosx'. Stop
make: *** [macsox] Error 2
I also changed the target of the same Makefile.std file in the src directory.
Is there something I'm missing here?
I have tried "make macosx" amongst other variations...
This should be easy.
Did you download the source from lua.org? The official distribution does not contain a Makefile.std. Doing "make macosx" should just work. Get the official tarball.
Note also that there are Lua packages in MacPorts and Fink.

Resources