Archived

This topic is now archived and is closed to further replies.

Mulligan

Template problems

Recommended Posts

I''m using VC++, and when I compile, I get unresolved external errors. Here are some: --------------------Configuration: VC3DFish - Win32 Debug-------------------- Compiling... apvector.cpp Linking... utils.obj : error LNK2001: unresolved external symbol "public: class Fish & __thiscall apvector::operator[](int)" (??A?$apvector@VFish@@@@QAEAAVFish@@H@Z) environ.obj : error LNK2001: unresolved external symbol "public: class Fish & __thiscall apvector::operator[](int)" (??A?$apvector@VFish@@@@QAEAAVFish@@H@Z) simulate.obj : error LNK2001: unresolved external symbol "public: class Fish & __thiscall apvector::operator[](int)" (??A?$apvector@VFish@@@@QAEAAVFish@@H@Z) environ.obj : error LNK2001: unresolved external symbol "public: __thiscall apvector::~apvector(void)" (??1?$apvector@VFish@@@@QAE@XZ) simulate.obj : error LNK2001: unresolved external symbol "public: __thiscall apvector::~apvector(void)" (??1?$apvector@VFish@@@@QAE@XZ) Yes, I am being forced to use the apvector class because I''ve been charged with creating a 3D graphics package to be used by some students. Any idea as to why I get all these errors?

Share this post


Link to post
Share on other sites
Yeah! The fish project! I did the same one last year. I believe it was a complete waste of time. I''m pretty familiar with APvector, but I don''t see enough info to help, wanna post the code generating the error?

Use the WriteCoolGame() function
Works every time

Share this post


Link to post
Share on other sites
Well, I would, but its way too much code to post. I could however send you a zip file of the folder that the project is in, you could take a look at it there is you wanted.

Share this post


Link to post
Share on other sites
I don''t have C++ currently installed, new computer, but if you could just show me how you are declaring/using the apvector class that''d be great. Have you used the apvector class succesfully before? And have you got the fish project running before trying to implement 3d? if so, what code did you add?

Use the WriteCoolGame() function
Works every time

Share this post


Link to post
Share on other sites
First off, the AP test requires knowledge of them, so you gotta practice. Which left me at a disadvantage when I got to college, I couldn''t remember how to do arrays. But the AP class prevents getting random crap when you access an array wrong, Instead it''ll just crash the program. LOL, but true.

Use the WriteCoolGame() function
Works every time

Share this post


Link to post
Share on other sites
quote:
Original post by alexk7
Does someone knows why they''re not using standard C++ classes in these courses ?


You think that''s bad? when I took the AP test it was in PASCAL!!! I had to give up half way through and just start writing C++, because I hadn''t had Pascal since 7th grade, and my school had no AP Computer Course. Fortunately they passed me anyways.

Share this post


Link to post
Share on other sites
The AP test uses its own classes so you can completely understand how every function works in those classes for the exam. Sometimes they will ask you to add functions to these classes on the test, and other times to change them.

I agree that it would be better to use STL (or use nothing at all), but there''s no way you could teach everything in the STL in high school.

I remember when I was so reliant on apstring because I didn''t like using char* and I didn''t want to learn std::string. Perhaps that is because I was so used to BASIC''s nice handling of string variables (allthough now I know how wasteful they can be).

By the way, I learned C++ by preparing for the AP exam. Not the best way, I''m sure, but I have since moved to either using STL (even though I have my gripes with it), or writing my own custom containers (it depends on the project at hand). I didn''t have a teacher that knew C++, and I was the only one in the class, so I think I did a pretty good job at getting a 5 on that test. In fact, I''m pretty damn sure I got every question right. That test was a lot more fun than the other AP exams I took (and I took most of them). It was the only exam that didn''t make me feel like a complete idiot (music theory did a great job at that).

And I don''t think anyone is going to convince the College Board to switch from using their ap classes. I think its a moot point, as my passing the AP exam in C++ only gave me credit for a C course and a Fortran course in college. That makes PERFECT sense, doesn''t it?

--TheMuuj

Share this post


Link to post
Share on other sites
If I remember right, the AP vector class required you to either

1) Put apvector.cpp in your project and compile it with your project (this is the correct way to do it, short of making a static library with the ap stuff)

2) Add a line at the bottom of apvector.h that includes apvector.cpp (#include "apvector.cpp") ... This isn''t technically correct but it makes it easier to use the ap headers

Try it and let me know. It has been a while since I messed with the ap stuff.

--TheMuuj

Share this post


Link to post
Share on other sites