GCC 10.1.0 on macOS Big Sur - c

I'm trying to Compile GCC 10.1.0 on macOS Big Sur with the new arm powered Mac. Due of the lack of tutorials for compiling on Big Sur, I decided to compile as if on Catalina using this tutorial. All was well until I ran the 'make' command which then gave me a series of confusing errors. Appending 'make' with '-j 8' returns a different error rather than just 'make' as shown below.
make -j 8
Making all in expr
Undefined symbols for architecture x86_64:
"__sch_istable", referenced from:
_main in fixincl.o
_initialize in fixincl.o
_process in fixincl.o
_char_macro_def_fix in fixfixes.o
_char_macro_use_fix in fixfixes.o
_format_fix in fixfixes.o
_wrap_fix in fixfixes.o
...
"__sch_toupper", referenced from:
_wrap_fix in fixfixes.o
_gnu_type_fix in fixfixes.o
"_fdopen_unlocked", referenced from:
_process in fixincl.o
_load_file in fixincl.o
_create_file in fixincl.o
_proc2_fopen in procopen.o
"_freopen_unlocked", referenced from:
_main in fixincl.o
_initialize in fixincl.o
"_xcalloc", referenced from:
_run_compiles in fixincl.o
_run_shell in server.o
"_xmalloc", referenced from:
_process in fixincl.o
_wrap_fix in fixfixes.o
_run_shell in server.o
"_xmalloc_set_program_name", referenced from:
_initialize in fixincl.o
"_xrealloc", referenced from:
_run_shell in server.o
_load_file_data in fixlib.o
"_xregcomp", referenced from:
_compile_re in fixlib.o
_mn_get_regexps in fixlib.o
"_xregerror", referenced from:
_compile_re in fixlib.o
_mn_get_regexps in fixlib.o
"_xregexec", referenced from:
_process in fixincl.o
_machine_name_test in fixtests.o
_char_macro_def_fix in fixfixes.o
_char_macro_use_fix in fixfixes.o
_format_fix in fixfixes.o
_machine_name_fix in fixfixes.o
_wrap_fix in fixfixes.o
...
"_xstrdup", referenced from:
_run_shell in server.o
"_xstrerror", referenced from:
_initialize in fixincl.o
_process in fixincl.o
_load_file in fixincl.o
_create_file in fixincl.o
_chain_open in procopen.o
_load_file_data in fixlib.o
ld: symbol(s) not found for architecture x86_64
make[6]: Nothing to be done for `all'.
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [full-stamp] Error 1
make[6]: Nothing to be done for `all-am'.
make[2]: *** [all-build-fixincludes] Error 2
make[2]: *** Waiting for unfinished jobs....
Making all in tune
make[5]: Nothing to be done for `all'.
Making all in doc
make[5]: Nothing to be done for `all'.
make[5]: Nothing to be done for `all-am'.
make[3]: Nothing to be done for `all'.
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
make
checking for __gmpz_init in -lgmp... no
configure: error: libgmp not found or uses a different ABI (including static vs shared).
Please read the INSTALL file -- see "In case of problem".
make[2]: *** [configure-stage1-mpfr] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
Below is a list of things I've tried when compiling GCC (I'm new to compiling GCC so any help would be appreciated!)
running 'make' with 'sudo'
Any help on resolving the errors would be greatly appreciated, thanks!

Related

Yet another Undefined symbols for architecture x86_64

I am stuck with this error:
mpif90 -o /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt edmain.o -L/opt/local/lib/libgcc/ -lstdc++ -I/Users/manfredo/Desktop/ED2/ED/src/include -I/opt/local/include /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt.a -lm -lz -L/opt/local/lib -lhdf5 -lhdf5_fortran
Undefined symbols for architecture x86_64:
"_calchydrosubsurface_", referenced from:
_ed_model_ in ed_2.1-opt.a(ed_model.o)
...
other similar errors
...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [/Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt] Error 1
make: *** [all] Error 2
I have tried adding -stdlib=libstdc++ or including the libraries lstdc++ or lstc++.6 as suggested here or here and I had already posted a question about the same error but still not able to fix it.
The compilation with mpif is needed. Any help will be appreciated.

VLC compilation fails on Mac with linking errors

I am trying to compile VLC like thus:
Download git clone https://github.com/videolan/vlc.git vlc.git
Build (as per https://wiki.videolan.org/OSXCompile/#Build_steps)
mkdir build && cd build
../extras/package/macosx/build.sh
which fails midway with the following error
make all-am
CCLD libsvg_plugin.la
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
Undefined symbols for architecture x86_64:
"_FSFindFolder", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_kCFAllocatorSystemDefault", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFURLCreateFromFSRef", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFURLCopyFileSystemPath", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetCStringPtr", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetLength", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFStringGetCString", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
"_CFRelease", referenced from:
_find_folder in libglib-2.0.a(libglib_2_0_la-gutils.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[5]: *** [libsvg_plugin.la] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Which libs are missing? And how do I add them to the build process?
Edit:
I am on Mac 10.7.5.

crc32() missing when building libzip on OSX 10.9

I've downloaded the latest release of libzip and am currently trying to build it on OSX and failing:
Linking C shared library libzip.dylib
Undefined symbols for architecture x86_64:
"_crc32", referenced from:
__zip_filerange_crc in zip_filerange_crc.o
_crc_read in zip_source_crc.o
_decrypt in zip_source_pkware.o
__zip_string_crc32 in zip_string.o
(maybe you meant: __zip_string_crc32)
"_deflate", referenced from:
_compress_read in zip_source_deflate.o
(maybe you meant: _zip_source_deflate)
"_deflateEnd", referenced from:
_deflate_compress in zip_source_deflate.o
"_deflateInit2_", referenced from:
_deflate_compress in zip_source_deflate.o
"_inflate", referenced from:
_decompress_read in zip_source_deflate.o
"_inflateEnd", referenced from:
_deflate_decompress in zip_source_deflate.o
"_inflateInit2_", referenced from:
_deflate_decompress in zip_source_deflate.o
"_zError", referenced from:
__zip_error_strerror in zip_error_strerror.o
_zip_error_to_str in zip_error_to_str.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libzip.3.0.dylib] Error 1
make[2]: *** [CMakeFiles/zip.dir/all] Error 2
make[1]: *** [CMakeFiles/zip.dir/rule] Error 2
make: *** [zip] Error 2
It needs a crc32 function but it doesn't include one nor does it seem to link to anything else. Has anyone been able to build libzip on OSX 10.9?
You seem to be missing to link a against libz.
Get the developer files for zlib somewhere and add -lz to the (end of the command line of the) link command.

Undefined symbols argp_parse and arpg_usage when installing rng-tools on OSX

I am currently trying to install rng-tools on OSX, as I have a specific need for it to speed up a certain simulator that I am currently using. At first, I faced the problem of not having argp, so I installed argp-standalone from Homebrew. However, I still receive the following error message when trying to make rng-tools:
gcc -g -O2 -o rngtest stats.o rngtest.o librngd.a
Undefined symbols for architecture x86_64:
"_argp_parse", referenced from:
_main in rngtest.o
"_argp_usage", referenced from:
_parse_opt in rngtest.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [rngtest] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I checked /usr/local/include/argp.h and it does seem to contain the correct function definitions referenced in rngtest.c, so any thoughts on what might be the problem?
I just needed rngtest which I managed to compile on OSX using this https://github.com/fproulx/rngtest (which also needs brew install argp-standalone). I made that into a homebrew formula which can be obtained here: https://github.com/oderwat/homebrew-experiments

c netbeans file was built for unsupported file format

Am trying to build a c program in netbeans on mac osx 10.7.5 and am getting the following error. I am not sure what is going on. I am trying to learn c.
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
mkdir -p dist/Debug/GNU-MacOSX
gcc -o dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/main.o
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_CreateList", referenced from:
_main in main.o
"_InsertItem", referenced from:
_main in main.o
"_DeleteItem", referenced from:
_main in main.o
"_PrintList", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 71ms)
If i put all the methods definitions in the main file instead of writing separately in implementation file, then it's building fine and showing no error.

Resources