Thread: what does this mean?!

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    180

    Question what does this mean?!

    what does:

    [Linker Error] Unresolved external '__fastcall TForm1::FormActivate(System::TObject *)' referenced from E:\MYDOCS\CHRIS\PHANTOM\UNIT1.OBJ


    mean?

    thx!

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    It might mean that in the file:

    E:\MYDOCS\CHRIS\PHANTOM\UNIT1.OBJ

    you attempt to use a function called

    FormActivate(System::TObject *)

    that is a member of the class

    TForm1::

    However, the linker couldn't find either a function declaration or function definition by the name of

    FormActivate(System::TObject *)

    in the file

    TForm.h

    or the file

    TForm.cpp

    Look at the function declaration and function definitions. Often the parameter lists are not the same or you forgot to provide a function definition completely or you don't have an appropriate file listed in the preprocessor directive list (the #include list) or the path to the file is in error or something like that. The point is the linker can't find the function you are trying to use anyplace it's been told it should look for it external to the current program file.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    180

    Question

    Excellent! That works great! I do have a question tho, what happens when I get that error msg, but with a class variable?

    ie:[Linker Error] Unresolved external '__Ship_1' referenced from E:\MYDOCS\CHRIS\PHANTOM\UNIT1.OBJ

    (thats not excatly what it says, but i'm at school atm, so i can't get the full erorr)

    Cheers

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Same thing. Undeclared class. Find it or fake it.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #5
    Registered User
    Join Date
    Mar 2004
    Posts
    180
    Quote Originally Posted by Sebastiani
    Same thing. Undeclared class. Find it or fake it.
    what do u mean, "Undeclared class"? How would I declare it? Cheers

  6. #6
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    To me "undeclared class" means that the class isn't declared anywhere the linker has been told to look. Maybe you spelled the class name wrong, or you gave the linker the wrong path to check, etc., just like with the function example.

    For example:
    Code:
    #include "MyClass.h"
    
    int main()
    {
      myClass example;
      return 0;
    }
    Assume MyClass.h defines the class as MyClass. The problem is myClass is a typo for MyClass. myClass example; is legal syntax so the compiler probably won't complain, but when the linker goes to find myClass, the only place it can look is in MyClass.h, and it's not there, so it sends an error message saying it's an "undeclared class" or it's an "unresolved external" linking error.

Popular pages Recent additions subscribe to a feed