Someone please help with my c++ code (I am beginner :() | SoloLearn: Learn to code for FREE!


Someone please help with my c++ code (I am beginner :()

So this is my code #include <iostream> int main() { //start std::cout << "Welcome to the volume calculator for rectangles and squares!\n\n\n"; int height; std::cout << "Inter Height: "; std::cin >> height; std::cout << "\n"; int width; std::cout << "Inter Width: "; std::cin >> width; std::cout << "\n"; int length; std::cout << "Inter Length: "; std::cin >> length; std::cout << "\n"; int volume = width * height * length; std::cout << "The volume is: " << volume; return 0; } Whenever I try to run it,it just shows: 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 I am so confused. UPDATE: Thank you everyone for your answers. It turns out there was a problem with my IDE but now it is fixed.

11/16/2019 6:39:33 PM

Alexander Zousky

4 Answers

New Answer


Alexander Zousky As Kit Delano Cat stated, there's no issue with the code as is, making me believe that this is an environmental issue as well. What ide did you use? Are you sure you installed things correctly? Did you update recently? These things and more can affect the execution environment

+1 The code runs fine in the playground. Please check that all braces ( { } ) have a counterpart. and are in the right place. Make sure you have a main method in your program And check all semicolons and everything that ace and kit have said keep coding, keep asking, you are doing well


Why don't you use ' using namespace std ' , Perhaps this help you and fixed the problem !!


im also new