Linking errors

Started by
10 comments, last by shalom 22 years, 3 months ago
Oh no! Now I''m having new problems. That worked for all my classes, but now I''m having trouble with global functions! I put a function in a .cpp file, which included a same-named .h file, which was also included in the main .cpp file. It came up with a whole bunch of compile errors, stuff about not recognizing the types of its arguments (which are classes defined elsewhere in the project), when these classes are clearly included in the project before the function!

What''s wrong?
Thanks again,
Shalom

In my thunking device, what happens to the inherited pointer to the original base class when I override the function & how do I access it in my inline assembly code, assuming that we are referencing the higher byte of the 16-bit variable?
In my thunking device, what happens to the inherited pointer to the original base class when I override the function & how do I access it in my inline assembly code, assuming that we are referencing the higher byte of the 16-bit variable?
Advertisement
Actually, I''ve had similar problems with global variables. Except that I always guard against multiple inclusion Yet I''d still get multiple definition linker errors. The worst part was, it wasn''t really consistent. I''d build, get the error, then recompile a file and build again, and no error. The linker would run, and the executable was fine. Build again (no code changes), and I get the linker error again. Very strange, and I never really figured out what my problem was. I just sortof cheated by declaring it in my main source file and then adding an extern reference to it in any other source files that needed to use it. Hackish, but it worked.

-Lutrosis
-Lutrosis#define WHOOPS 0class DogClass {public: CDog() { printf("Ruff!"); } Run() { printf("Run!"); } Crash() { printf("%d",100/WOOPS); }};DogClass CDog;CDog.Run();CDog.Crash();

This topic is closed to new replies.

Advertisement