Undefined Symbols For Architecture X86_64 Mac



Mac Undefined symbols for architecture x8664 #221. Closed weewillie opened this issue Jun 4, 2014 11 comments Closed Mac Undefined symbols for architecture x8664. Undefined symbols for architecture x8664 on Mac OS X Issue #61, Undefined symbols for architecture x8664 on Mac OS X #61. TisonKun opened this issue on Sep 18, resolve by gcc main.c -luv mbp-mbp 09:24:18 /bin $ gcc connect.c -o connect. I am trying to provide working Intel examples in both Mac OS and Microsoft Visual Studio environments. I am using Xcode 7.2, build 7C68. I am receiving the following message in the link step: Undefined symbols for architecture. I have tried varying the build architecture between x8664 and i386, as well as the default, with no effect. Macos - C - Undefined symbols for architecture x8664 when compiling on Mac OSX Lion Translate I'm getting some problems on compiling a very very simple name.c file on Mac OSX Lion.

Question or issue on macOS:

I am using the gfortran compiler on mac osx mavericks. I have installed Xcode and command line tools. I am trying to compile a simple helloworld program with gfortran to test whether everything works, but unfortunately it doesn’t work. The error message seems to suggest that I have no main function, but I don’t see the error in the code:

But when i try to compile using

I get the following error:

I do not understand what is wrong and I am on the verge of despair. I tried with gfortran 4.8.2 as well as gfortran 4.9.0, I tried reinstalling Xcode and Command Line Tools but nothing seems to work.

I am aware similar questions have been asked, but I was not able to find a solution to my problem. I would be happy even with a sloppy workaround, as long as I can get the compiler to run…

How to solve this problem?

Oh my dear. Found the solution about a minute after staring the bounty. Rather than using the recommended installer from https://gcc.gnu.org/wiki/GFortranBinaries I just installed it with

The gfortran now compiled without complaining.

Hope this helps!

What is going on here? I can't seem to build with gcc. How can I fix this.


mbp-mbp 09:24:18 ~/bin $ gcc connect.c -o connect

Undefined symbols for architecture x86_64:

'_res_9_init', referenced from:

_switch_ns in ccTLCqYq.o

ld: symbol(s) not found for architecture x86_64

X86 64 architecture

collect2: error: ld returned 1 exit status

mbp-mbp 09:26:14 ~/bin $ gcc -v

Using built-in specs.

COLLECT_GCC=gcc

Undefined Symbols For Architecture X86_64 Mac Os X

COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc/4.8.3/libexec/gcc/x86_64-apple-darwin1 3.2.0/4.8.3/lto-wrapper

Target: x86_64-apple-darwin13.2.0

Undefined

Configured with: ../configure --build=x86_64-apple-darwin13.2.0 --prefix=/usr/local/Cellar/gcc/4.8.3 --enable-languages=c,c++,objc,obj-c++,fortran --with-gmp=/usr/local/opt/gmp --with-mpfr=/usr/local/opt/mpfr --with-mpc=/usr/local/opt/libmpc --with-cloog=/usr/local/opt/cloog --with-isl=/usr/local/opt/isl --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --enable-plugin --disable-nls --enable-multilib

Thread model: posix

gcc version 4.8.3 (GCC)


5.1.1 xcode nad command line tools


OSX 10.9.3

X86 Vs X86 64


Cheers

Undefined Symbols For Architecture X86_64 Mac G++

Posted on Jun 14, 2014 12:34 PM