Greetings! I'm working through C++ Primer Plus (Prata, 5E) and am working with operator overloading. The exercise I'm working on deals with converting char * to custom String class objects.
My trouble lies in writing overloading functions for this: String rgb[3] = { String(s1), String("green"), String("blue")};
Assigning the individual arguments to String objects works, but bringing them together in the above assignment has me stumped.
While the following doesn't work, I thought it might help explain what I'm trying to do:
I'm getting Linker errors (LNK1120 and LNK2019 with Visual Studio C++ 2008) and thought attempting to overload the braces (which isn't allowed) might fix it. I'm combing over my code and searching those errors for clues.
Thanks!
Download cryptopp source. Find it on google. Download it and build the cryptlib.vcproj in Debug and Release Modes.
Building process:
1. Download cryptopp.
2. Copy .h files from 'include' folder and paste it into 'surce' folder in cryptopp.
3. open cryptlib.vcproj file in VC++.
4. Build the solution in Debug and Release modes.
5. Rename Cryptlib.lib in debug folder to 'Cryptlib08.lib' and rename cryptlib.lib in release folder to 'cryptlib08d.lib' .
6.Copy both the renamed .LIB files into your project LIB folder or declare the address of your linker into your project. ( Its better you copy both files in your Linker folder).
I don't know what cryptopp is, but if you aren't using it for your project, you certainly don't need to download and install it. And there's no way it is causing your linker errors if you don't have it installed in the first place.
I would disregard Ronny's post for now and just show us your error message. I'd wager my lunch money that it's due to a prototyped function with no body.
Hey, thank you for the help. I looked over my class methods and there were several prototypes without definitions. When I commented the prototypes out, the link errors went away. Some new ones popped up upon runtime, but I think I just need to go back and understand the topics a little better.