I am doing different exercises in c++ for preparing my exam at university. I am pretty sure they are all without heavy mistake and should complement.
All codes can't complement with the same error log:
Undefined symbols for architecture x86_64:
[hundreds lines of error log]
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error log between is about every single line of code.
I am wondering if I've missed to install some package for complement c++ on my device.
Code Example:
#include <iostream>
#include <new>
int main () {
int n;
std::cout<<"How many value do you want to enter to your list?"<< std::endl;
std::cin>>n;
int* numbArray = new int[n];
for(int i = 0; i<n; i++) {
std::cout<<"Enter the"<< i+1 <<". value!"<<std::endl;
std::cin>>numbArray[i];
}
std::cout << "List of value: " << std::endl;
for(int i=0; i<n; i++ ) {
std::cout<<numbArray[i]<<" "<<std::endl;
}
std::cout<<"end of arrays"<<std::endl;
delete[]numbArray;
return 0;
}
My operating System is macOS Catalina 10.15.2
Thanks for your help.