-
Now I'm running into a compile error when I declare an extern variable.
I get this error from clang:
Code:
Undefined symbols for architecture x86_64:
"_pmsdMath", referenced from:
_funcPMSD in mathematics-99e99e.o
"_pmsdNumber0", referenced from:
_main in main-aa69d6.o
_funcPMSD in mathematics-99e99e.o
"_pmsdNumber1", referenced from:
_main in main-aa69d6.o
_funcPMSD in mathematics-99e99e.o
"_pmsdTotal", referenced from:
_funcPrintResult in mathematics-99e99e.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
However, if I take out the extern variables, it compiles but doesn't print out any results.
-
You haven't grasped this "no global variables and pass parameters instead" thing.
Code:
void funcPMSD( int pmsdMath ) {
double pmsdTotal;
if(pmsdMath == 1) {
And main calls it with
-
Thank you! I don't know why my brain was making it so difficult to understand that but I got it!
Thank you so much! It's working now!
Thanks for helping with the breakthrough.