Error : "error LNK2001: unresolved external symbol"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karthikvis
    New Member
    • Feb 2007
    • 1

    Error : "error LNK2001: unresolved external symbol"

    Hi,

    I would really appreciate it of someone could help me. I tried compiling a source code which references header files from another directory on my hard disk (not the default VC++ header files directory). I added this directory name as an extra line in "Tools>Options> Directories..." for include files.

    My source code looks like this :

    Code:
    #include "IGESControl_Reader.hxx"
    #include "TColStd_HSequenceOfTransient.hxx"
    #include "TopoDS_Shape.hxx"
    
    main()
    {
    IGESControl_Reader myIgesReader;
    Standard_Integer nIgesFaces,nTransFaces;
    
    myIgesReader.ReadFile ("MyFile.igs");
    //loads file MyFile.igs
    
    Handle(TColStd_HSequenceOfTransient) myList = myIgesReader.GiveList("iges-faces");
    
    //selects all IGES faces in the file and puts them into a list called MyList,
    
    nIgesFaces = myList->Length();
    nTransFaces = myIgesReader.TransferList(myList);
    //translates MyList,
    
    cout<<"IGES Faces: "<<nIgesFaces<<" Transferred:"<<nTransFaces<<endl;
    TopoDS_Shape sh = myIgesReader.OneShape();
    
    //and obtains the results in an Open CASCADE shape.
    }

    The errors that I get are "error LNK2001: unresolved external symbol "public: __thiscall Handle_TColStd_ HSequenceOfTran sient::~Handle_ TColStd_HSequen ceOfTransient(v oid)" (??1Handle_TCol Std_HSequenceOf Transient@@QAE@ XZ)"

    Any help from anyone will be apreciated.

    Thanks a bunch !

    -Karthik
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    An unresolved external happens when you declare a function or variable but do not define it. Declarations tend to happen in header files and definitions tend to happen in source files.

    In this case it appears to be the destructor for Handle_TColStd_ HSequenceOfTran sient

    This suggests that there is another C++ source file that needs to be compiled and linked in the program or that there is a library that the program needs to be linked with.

    Comment

    Working...