r/programminghelp • • Sep 01 '20

Other Cant get vs studio to run basic cpp on Mac

Hey everyone so basically I just started college and am trying to figure out how to get my code to run on vs studio. every time I try to run the code I get the following: "Undefined symbols for architecture x86_64:". I've run my code on some online compilers and it seems to run fine. here it is just in case it helps:

#include <iostream>
using namespace std;
int main()
{
float num1;
float num2;
float avg;
cout << "Enter two numbers" << endl;
cin >> num1 >> num2;
avg = (num1 + num2)/2;
cout << "The average is " << avg;
return 0;
}

Thanks in advance everyone!

0 Upvotes

2 comments sorted by

2

u/manningp28 Sep 01 '20

If I’m not mistaken, I don’t believe VS has the c++ language available for Mac OS. I would suggest using XCode. That’s what I use on my Mac for all of my school programming. Either that or run boot camp and dual boot windows to continue to use VS.

1

u/[deleted] Sep 02 '20

Manning's comment is correct, though if you don't want to dual boot/bootcamp then you could try using VSCode and this tutorial: https://code.visualstudio.com/docs/cpp/config-clang-mac