Post your question to a community of , developers. Sign in Join Now. New Post. Florian Haag. I tried removing the relative path in include, but that only results in an additional error message saying that the file Rectangle. I also made sure I don't have any other file called Rectangle. Thanks in advance, Florian. Follow Post Reply. Make sure that the last statement above line 25 has a ; at the end. Regards, thanks in advance, Florian. Kai-Uwe Bux. Well, in removing that code, you probably removed the error.
See if this solution works for you by signing up for a 7 day free trial. What do I get with a subscription? With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Who are the certified experts? How quickly will I get my solution? We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Although nothing prevents you from including C files or any other file its not usually done. They will both compile fine but when they get linked togather you have every line of code duplicated in the binary and the link will fail.
Same is true if you try to put functions in the header file you only declare them not define them in the header. So general rule is header files for types and function declarations and then the c file for the definitions. Now for the problem you are seeing, Darryl has it right.
Benny also, about your post 5. Are you suggesting suppose that in a project I have the following files: matrix. And include, matrix. I think I am not getting this right. I would appreciate if you can clarify this. After doing this and removing that statement that includes a.
I do not know what compiler you are using but removing that std actually creates errors in my program. You may be right, but removing std gives me even more new errors. So I am still puzzled about this. Here is the code I got to compile. Expand Select Wrap Line Numbers. And it worked fine. I got the following code to compile and run, and give the correct results. No, you are not getting this right.
If main. Instead, you have multiple. NET and it compiles fine. So my question is what compiler are you using? Yours hides it and thereby will scrogg your STL at some point. You need to put stuff in a namespace and stop creating functions in the global namespace. That's why the std namespace was created in the first place: to avoid name collsions with functions already created as global functions: Expand Select Wrap Line Numbers. Phiefer3, I agree with your last suggestion.
Thanks for that. However, I have a question about this. What exactly are we losing in terms of generality compared to the previous code?
0コメント