The below code is giving me an error. I'm cannot find the problem. I'm listing the code and the errors Xcode is giving me.
I'm trying to write the definition of the method in my class called "func()". I'm suppose to set the values of u and w to u = 10 and w = 15.3. Any ideas to what i'm doing wrong that is producing the following errors.
THE ERROR MESSAGE:
1 2 3 4 5 6 7 8 9 10
Ld /Users/shaneyost/Library/Developer/Xcode/DerivedData/Class-giwnenmhkdglsoetwznfoarxdnqg/Build/Products/Debug/Class normal x86_64
cd "/Users/shaneyost/Desktop/NEST/XCODE FILES/Class"
setenv MACOSX_DEPLOYMENT_TARGET 10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/shaneyost/Library/Developer/Xcode/DerivedData/Class-giwnenmhkdglsoetwznfoarxdnqg/Build/Products/Debug -F/Users/shaneyost/Library/Developer/Xcode/DerivedData/Class-giwnenmhkdglsoetwznfoarxdnqg/Build/Products/Debug -filelist /Users/shaneyost/Library/Developer/Xcode/DerivedData/Class-giwnenmhkdglsoetwznfoarxdnqg/Build/Intermediates/Class.build/Debug/Class.build/Objects-normal/x86_64/Class.LinkFileList -mmacosx-version-min=10.8 -stdlib=libc++ -o /Users/shaneyost/Library/Developer/Xcode/DerivedData/Class-giwnenmhkdglsoetwznfoarxdnqg/Build/Products/Debug/Class
Undefined symbols for architecture x86_64:
"xClass::xClass()", 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)
I haven't even wrote the definition of them yet. So i'm taking it that when designing a class you have to write the definition for all functions "methods" before the program will compile?
Not necessarily all of the functions, just the functions that you are actually using. The problem you are having is that you are trying to use a class where you defined the class constructors, but haven't implemented them.