I am using a MacBook, if that helps, and running this code through Terminal.(It is literally just clicking the Build and Run button in CodeBlocks and having the results displayed in Terminal such as "print out a message" or "running a for loop" ).
I only pressed "Build and run" (F9) in CodeBlocks and I got these errors and weird messages.
Click to see error Click to see CodeBlocks glitch
(Right after I hit "yes" , it displayed
Why doesn't this run?
I'm really confused. Can someone explain what needs to be changed in order for it to execute the constructor for the Burrito object I just created in the main.cpp file?
I compile by using the Build and Run button in CodeBlocks. I don't know any other method of running the program.
Click to see how I build and run/compile
//main.cpp
#include <iostream>
#include "Burrito.h"
using namespace std;
int main()
{
Burrito bo;
return 0;
}
//Burrito.h
#ifndef BURRITO_H
#define BURRITO_H
class Burrito
{
public:
Burrito();
};
#endif // BURRITO_H
// Burrito.cpp
#include "Burrito.h"
#include <iostream>
using namespace std;
Burrito::Burrito()
{
cout << "hey now " << endl;
}
Error message:
Undefined symbols for architecture x86_64:
"Burrito::Burrito()", referenced from:
_main 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)
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))