Solution for Undefined symbols for architecture x86_64: "_main" - terminal

MyMac#Macbook Cs50 % make adab
cc adab.c -o adab
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [adab] Error 1
I got this error because my file adab.c was empty, i wrote some simple code and saved the file, then executed "make adab".
MyMac#Macbook Cs50 % make adab
cc adab.c -o adab
MyMac#Macbook Cs50 %
Hope this is helpful for beginners like me :)

Related

How to connect OpenCV to Xcode?

The path:
/usr/local/include
/usr/local/lib
Outputs such an error:
Undefined symbols for architecture x86_64:
"cv::String::deallocate()", referenced from:
cv::String::~String() in main.o
cv::String::operator=(cv::String const&) in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to fix this error?

Undefined symbols for architecture x86_64: "_pcap_findalldevs"

Undefined symbols for architecture x86_64:
"_pcap_findalldevs", referenced from:
allNetworkDevices() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
in the manPage is nothing about libraries or something like that - what I have to do?
I made a 'clean' before build.
and also: rm -rf ~/Library/Developer/Xcode/DerivedData
--Now:
Undefined symbols for architecture x86_64:
"_pcap_findalldevs", referenced from:
allNetworkDevices() in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
And: Where can I set this '-v'

Undefined symbols for x86_64 architecture on mac

I am trying to compile a code that uses the FFTW libraries. I have installed these and have checked using lipo that they are installed for x86_64 architecture. However when I try to compile I get the following error
mpif90 -r8 -O3 -assume byterecl -u -I/usr/local/mpich2/include -I/usr/local/fftw_215_mpich2/include -L/usr/local/fftw_215_mpich2/lib -I./OBJ/ ./SRC/tt_main.f90 ./OBJ/xx_exter.o ./OBJ/tt_fft.o ./OBJ/tt_force.o ./OBJ/tt_init.o ./OBJ/tt_io.o ./OBJ/tt_les.o ./OBJ/tt_update.o ./OBJ/tt_stat.o ./OBJ/tt_mod.o ./OBJ/xx_mod.o -o turbo -ldfftw -ldrfftw -ldfftw_mpi -ldrfftw_mpi -lm
Undefined symbols for architecture x86_64:
"_rfftwnd_f77_mpi_", referenced from:
_fft3ds_ in tt_fft.o
_ifft3ds_ in tt_fft.o
"_rfftwnd_f77_mpi_create_plan_", referenced from:
_init_fft3d_ in tt_fft.o
"_rfftwnd_f77_mpi_local_sizes_", referenced from:
_init_fft3d_ in tt_fft.o
ld: symbol(s) not found for architecture x86_64
make[1]: *** [turb] Error 1
make: *** [turbo] Error 2
Can anyone help?

multiple errors with my audio toolbox

i have 3 errors and one warning when trying to play sound on my app. i am fairly new to xcode.
ld: warning: ignoring file /Users/harrisschrick/Documents/Test app/AudioToolbox.framework/AudioToolbox, missing required architecture x86_64 in file /Users/harrisschrick/Documents/Test app/AudioToolbox.framework/AudioToolbox (3 slices)
Undefined symbols for architecture x86_64:
"_AudioServicesCreateSystemSoundID", referenced from:
-[humordepotViewController viewDidLoad] in humordepotViewController.o
"_AudioServicesPlaySystemSound", referenced from:
-[humordepotViewController PlayAudioButton:] in humordepotViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
any help at all would be amazing!

Xcode error - Undefined symbols for architecture x86_64:

I have this error in XCode:
Undefined symbols for architecture x86_64:
"Parser::Parser(char const*)", referenced from:
___cxx_global_var_init in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Very common reason is using a static library that is compiled for 32 bit only.

Resources