Reputation: 129 Stalwart
- Author w/DIC++
- Active Posts:
- 1,295 (0.72 per day)
- 13-June 08
- Profile Views:
- Last Active:
- May 19 2013 10:44 AM
- OS Preference:
- Who Cares
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Dream Kudos:
Posts I've Made
Posted 16 May 2013As an aside, your line 44 of ws2wrap.h should be between lines 2 and 3.
Anyway, are those all your files, or do you have more? The type of error above usually comes up when you have circular header file dependencies.
In your case, though, I suspect that it is the capital 'P' on private on line 20 which is the source of your problem.
That's all of them.
As an aside, I actually took most of this code right from: http://msdn.microsof...1(v=vs.85).aspx
All the socket stuff is basically copy pasted with different values. And if I copy paste that whole document it compiles fine.
I keep trying this in codeblocks too and it basically tells me the same thing.
C:\Users\Charles\github\Programming\C++\Socket Wrapper\Winsock 2.0\Winsock2Wrapper\WS2Wrap.h|43|error: abstract declarator '<anonymous class>' used as declaration|
Not sure how class WS2Wrap is anonymous.
And I fixed my own problem. I would really like to know what was wrong with WS2Wrap, but apparently it doesn't like it. I had to change my class name to Winsock2Wrapper.
Posted 16 May 2013If you "expect" these warnings then I suggest you read your compiler documentation to see if you can turn these warnings off.
Or maybe it's time you upgraded your compiler. What version of the compiler are you using?
In my opinion, tr1 should be considered depreciated in favor of the current C++ standard, C++11.
At the time, Visual Studio was the only IDE that had a definition for TR1. C++11 did not exist yet either. The TR1 warnings were simply an example from awhile ago. Now however, C++11 is TR1 so you're right, there's no reason anymore to use TR1.
I use Visual Studio 2012 Ultimate, the example from TR1 was from 2010.
Me personally, the safe version warnings can be ignored. If you know you don't want the safe warnings well then that's your choice. The Win32 API does this a lot. I could turn them off, I don't particularly want to, because sometimes I do mean to use safe and forget to. I don't like turning any warnings off and I like to have the verbose and strict warning settings.
Posted 16 May 2013
Posted 16 May 2013Also, based on your above code this shouldn't compile. You pass 0 to functions that require a pointer to a float variable.
The code does (and should) compile just fine. It is perfectly valid to pass 0 to a function expecting a pointer - that will simply call the function with a null pointer. Of course those functions shouldn't be called with null pointers as arguments, but the compiler doesn't know that.
I consider Any code that produces warning to not be compiled(unless those warnings are normal), that's also why I said shouldn't within the context of it does but really shouldn't.
I guess you can say I'm a fan of strict type enforcement.
Posted 16 May 2013Why would radius be passed to any other function? As it stands right now you are just passing zero.
Also, based on your above code this shouldn't compile. You pass 0 to functions that require a pointer to a float variable. You can pass 0 for the function that requires a straight float variable, but only for that one argument. As to parameter lists.
Input Radius takes a pointer to a float. IE
Volume takes a float variable and a pointer. IE
Float *myExample; Float vol;
I think you can get the last one.
Also, int main not float main.
- Member Title:
- It's That Guy
- 24 years old
- April 2, 1989
- Never, Never Land.
- Programming, Gaming, Hanging Out, Chatting, Blogging, Forum Posting.
- Full Name:
- Years Programming:
- Programming Languages: