I am learning Chapter 12 of "Programming - Principle and Practice (Second edition)" and I met some problems while doing its Drill. After I include "Graph.h", add "Graph.cpp"(Path is right) to my project and want to complie, Visual C++ complier reports a lot of errors, all from the two files above. FLTK works well. Anyone who has the book and succeeded in getting the program to complie? Pls show me how to.
I can't take all the credit (I found a lot of it online), they're not the best, and no assurance that they'll work, but you should download those files, and verify you followed the directions for installing FLTK VERY, VERY, VERY carefully. Mind you, I "corrected" those months ago when I had no real business even being in the headers.
EDIT: And for the love of God, install it as it instructs in Appendix A, then run the test!
Thing is, I don't even know if it was backwards compatibility or just erroneous headers though. I must have spent 12 hours racking my brain trying to sort it out (that's not an exaggeration) and using the web to locate answers, and a significant portion of it was needing to comment out specific lines. I kept those files on-hand specifically because I figured another beginner would have the same issues. Glad I did now.
By no means am I perfect, and I don't expect it from Stroustrup either, but I sincerely hope it's a backwards compatibility issue, because it was one of the most frustrating parts I've had (so far) in programming, and by no means at the time (and for the most part to this day) had no real idea what I was doing. That's an awful burden to lay on the beginner.
After using the head and .cpp files you provide, my program can, for the first time, complie and run. Hope that everyone that have the same problem try this solution.
Glad to hear it man. I'll leave it up, or if someone wants to publish it somewhere else in case I accidentally delete them that would be great too.
I considered skipping those chapters because of the frustration getting it to work, but I'm glad I didn't. They're REALLY important chapters you'd do well to take your time on.