Link32 Error

Posted on 2011-05-09
Last Modified: 2013-11-23
Hi, after change of computer, re-installation of RAD Studio 2007, I started working on an existing C++ window form application project (> 1.5 milj lines of code) that's been in use for several years now. I started updating the code according to new user demands, testing it etc. and it all seem to work fine. Suddenly when I'm re-building the project there's linking error that hasn't not been there before. I've going through all paths etc. in "Project Options" and everything seem to be as expected but still the linking issue remains unsolved.
I've spent several days in trying to solve this and now I start to get desperate so please anyone!

[ILINK32 Error] Error: Unresolved external '__fastcall TCCEditOverheads::FormCreate(System::TObject *)' referenced from C:\DOCUMENTS AND SETTINGS\W70FA-ZCONMA00P\MY DOCUMENTS\RAD STUDIO\PROJECTS\COMBCALC2005\TMP\EDITOVERHEADS.OBJ

Question by:peer754
    LVL 7

    Expert Comment

    I think there can be problem with same source files in different directories.
    Where is TCCEditOverheads defined ? Try to find duplicate files for that class.

    Also look for duplicete sourcefiles for editoverheads.obj file


    Author Comment

    Hi, I'm not sure I understand what you mean with "same source files in different directories"
    There are backup source files on a different path not visible for the project file (.bcb).
    I removed all .obj files I could find (there were duplicates within the Release, Debug and tmp directories) and rebuild the project but with the same error.
    LVL 32

    Accepted Solution

    you should take that error message as it is. the linker misses an implementation of TCCEditOverheads::FormCreate(System::TObject *)'

    what i wonder is that the object file where the request for the symbol comes from

    what seems to be a temporary folder. youu should check whether the editoverhead.obj is valid and has current timestamp.

    you should check that and look in the source for EDITOVERHEADS whether there is a call FormCreate and whether the arguments match to the implementation. i



    Author Comment

    I just named that folder tmp.

    As you can see in attached header file there is a reference to FormCreate() method. However, no other form in my project has this reference in its header and I therefore removed it and voilá it linked.
    There is no implementation of a FormCreate within the corresponding .cpp and I don't honestly know how it got there in the first place.
    #ifndef EditOverheadsH
    #define EditOverheadsH
    #include <Classes.hpp>
    #include <Controls.hpp>
    #include <StdCtrls.hpp>
    #include <Forms.hpp>
    #include "sitem.h"
    #include <ExtCtrls.hpp>
    #include <ComCtrls.hpp>
    using namespace Structure;
    class TCCEditOverheads : public TForm
    	__published:	// IDE-managed Components
    	TLabel *lbTitleText;
    	TLabel *Label13;
    	TLabel *Label15;
    	TLabel *Label17;
    	TLabel *Label18;
    	TLabel *lbIntCur;
    	TLabel *lbIndex;
    	TLabel *lbIntCurIndex;
    	TLabel *lbContext;
    	TLabel *lbParameterStatus;
    	TButton *ConfirmBut;
    	TButton *CloseBut;
    	TButton *ToggleCtxtBut;
    	TButton *UpdateProjBut;
    	TButton *UnlockBut;
    	TMemo *ebIntCurIndex;
    	TMemo *ebWarrantyOH;
    	TMemo *ebPenaltyOH;
    	TMemo *ebRiskContOH;
    	TMemo *ebInternalIntRate;
    	TLabel *Label1;
    	TLabel *Label2;
    	TLabel *Label3;
    	TShape *Shape1;
    	TShape *Shape2;
    	TLabel *Label4;
    	TLabel *lbInternalIntRate;
    	TMemo *ebInternalCurrency;
    	TLabel *Label5;
    	TLabel *lbSellExLocal;
    	TMemo *ebSellExI4OH;
    	TMemo *ebSellExLocalOH;
    	TLabel *Label6;
    	TMemo *ebProvisionExtOH;
    	TLabel *Label7;
    	TLabel *Label32;
    	TLabel *Label40;
    	TLabel *Label44;
    	TLabel *Label48;
    	TLabel *Label52;
    	TLabel *Label60;
    	TLabel *Label9;
    	TMemo *ebFixSurchargeOH;
    	TMemo *ebInsuranceOH;
    	TMemo *ebBankGOH;
    	TMemo *ebLocTaxOH;
    	TMemo *ebDutyOH;
    	TMemo *ebECAOH;
    	TMemo *ebHedgingOH;
    	TMemo *ebOtherSpecialOH;
    	TLabel *Label8;
    	TMemo *ebProvisionIntOH;
    	TLabel *label20;
    	TMemo *ebNegMarginOH;
    	TLabel *label21;
    	TMemo *ebEVAOH;
    	TLabel *Label10;
    	TLabel *Label11;
    	TShape *Shape3;
    	TLabel *Label12;
    	TMemo *ebEBITOH;
    	TLabel *Label14;
    	TRichEdit *reNote;
    	TLabel *Label16;
    	TMemo *ebIPROH;
    	TLabel *Label19;
    	TMemo *ebRDOH;
    	TLabel *Label22;
    	TLabel *Label23;
    	TMemo *ebSalesOH;
    	TLabel *Label24;
    	TLabel *Label25;
    	TMemo *ebAdminOH;
    	TMemo *ebSectDivChargeOH;
    	TLabel *Label26;
    	TLabel *Label27;
    	TLabel *Label28;
    	TLabel *Label29;
    	TMemo *ebScrapOH;
    	TLabel *Label30;
    	TLabel *Label31;
    	TLabel *Label34;
    	TMemo *ebSellExOH;
    	TLabel *Label35;
    	TLabel *Label36;
    	TShape *Shape4;
    	void __fastcall FormActivate(TObject *Sender);
    	void __fastcall FormUpdate(TObject *Sender);
    	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    	void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
    	void __fastcall ConfirmButClick(TObject *Sender);
    	void __fastcall CloseButClick(TObject *Sender);
    	void __fastcall UnlockButClick(TObject *Sender);
    	void __fastcall ebInternalIntRateExit(TObject *Sender);
    	void __fastcall ebWarrantyOHExit(TObject *Sender);
    	void __fastcall ebSellExLocalOHExit(TObject *Sender);
    	void __fastcall ebSellExI4OHExit(TObject *Sender);
    	void __fastcall ebPenaltyOHExit(TObject *Sender);
    	void __fastcall ebRiskContOHExit(TObject *Sender);
    	void __fastcall ebProvisionExtOHExit(TObject *Sender);
    	void __fastcall ebFixSurchargeOHExit(TObject *Sender);
    	void __fastcall ebInsuranceOHExit(TObject *Sender);
    	void __fastcall ebBankGOHExit(TObject *Sender);
    	void __fastcall ebLocTaxOHExit(TObject *Sender);
    	void __fastcall ebDutyOHExit(TObject *Sender);
    	void __fastcall ebECAOHExit(TObject *Sender);
    	void __fastcall ebHedgingOHExit(TObject *Sender);
    	void __fastcall ebOtherSpecialOHExit(TObject *Sender);
    	void __fastcall ebProvisionIntOHExit(TObject *Sender);
    	void __fastcall ebNegMarginOHExit(TObject *Sender);
    	void __fastcall ebEVAOHExit(TObject *Sender);
    	void __fastcall ebEBITOHExit(TObject *Sender);
    	void __fastcall ebWarrantyOHEnter(TObject *Sender);
    	void __fastcall ebSellExLocalOHEnter(TObject *Sender);
    	void __fastcall ebSellExI4OHEnter(TObject *Sender);
    	void __fastcall ebPenaltyOHEnter(TObject *Sender);
    	void __fastcall ebRiskContOHEnter(TObject *Sender);
    	void __fastcall ebProvisionExtOHEnter(TObject *Sender);
    	void __fastcall ebFixSurchargeOHEnter(TObject *Sender);
    	void __fastcall ebInsuranceOHEnter(TObject *Sender);
    	void __fastcall ebBankGOHEnter(TObject *Sender);
    	void __fastcall ebLocTaxOHEnter(TObject *Sender);
    	void __fastcall ebDutyOHEnter(TObject *Sender);
    	void __fastcall ebECAOHEnter(TObject *Sender);
    	void __fastcall ebHedgingOHEnter(TObject *Sender);
    	void __fastcall ebOtherSpecialOHEnter(TObject *Sender);
    	void __fastcall ebProvisionIntOHEnter(TObject *Sender);
    	void __fastcall ebNegMarginOHEnter(TObject *Sender);
    	void __fastcall ebEVAOHEnter(TObject *Sender);
    	void __fastcall ebEBITOHEnter(TObject *Sender);
    	void __fastcall ebInternalIntRateEnter(TObject *Sender);
    	void __fastcall ebIntCurIndexEnter(TObject *Sender);
    	void __fastcall ToggleCtxtButClick(TObject *Sender);
    	void __fastcall UpdateProjButClick(TObject *Sender);
    	void __fastcall UpdateCostGroups(TObject *Sender);
    	void __fastcall ebInternalCurrencyEnter(TObject *Sender);
    	void __fastcall ebNoteExit(TObject *Sender);
    	void __fastcall reNoteExit(TObject *Sender);
    	void __fastcall ebIPROHEnter(TObject *Sender);
    	void __fastcall ebIPROHExit(TObject *Sender);
    	void __fastcall ebRDOHEnter(TObject *Sender);
    	void __fastcall ebRDOHExit(TObject *Sender);
    	void __fastcall ebSalesOHExit(TObject *Sender);
    	void __fastcall ebSalesOHEnter(TObject *Sender);
    	void __fastcall ebAdminOHEnter(TObject *Sender);
    	void __fastcall ebAdminOHExit(TObject *Sender);
    	void __fastcall ebSectDivChargeOHEnter(TObject *Sender);
    	void __fastcall ebSectDivChargeOHExit(TObject *Sender);
    	void __fastcall ebScrapOHExit(TObject *Sender);
    	void __fastcall ebScrapOHEnter(TObject *Sender);
    	void __fastcall FormCreate(TObject *Sender);
    	void __fastcall ebSellExOHEnter(TObject *Sender);
    	void __fastcall ebSellExOHExit(TObject *Sender);
    private:	// User declarations
    	bool IsAuthorizedEdit;
    	bool HasChanged;
    	bool IsMaster;
    	TStructItem *TempNode;
    	TStructItem *ContextNode;
    	bool EditMode;
    	AnsiString timestring;
    	AnsiString timemode;
    	AnsiString note;
    	double ProvisionExtOH;
    	double FixSurchargeOH;
    	double InsuranceOH;
    	double BankGOH;
    	double LocTaxOH;
    	double DutyOH;
    	double ECAOH;
    	double HedgingOH;
    	double OtherSpecialOH;
    	double RiskContOH;
    	double WarrantyOH;
    	double PenaltyOH;
    	double ProvisionIntOH;
    	double sellExLocalOH;
    	double sellExI4OH;
    	double NegMarginOH;
    	double EVAOH;
    	double EBITOH;
    	double internalintrate;
    	double IPROH;
    	double RDOH;
    	double AdminOH;
    	double SectDivChargeOH;
    	double SalesOH;
    	double SellExOH;
    	double ScrapOH;
    	void __fastcall updateSellingEx();
    public:		// User declarations
    	__fastcall TCCEditOverheads(TComponent* Owner, bool IsAuthorizedEdit_in);
    extern PACKAGE TCCEditOverheads *CCEditOverheads;

    Open in new window


    Author Comment

    Oooh, I forgot to say THANK YOU Sara!!! :D I promise to read the complete error message next time :-o

    LVL 32

    Expert Comment

    i am glad if my comment was helpful.

    normally the linker shouldn't complain if there wasn't an implementation of a function never called.

    but the statement

         extern PACKAGE TCCEditOverheads *CCEditOverheads;

    means that there is a global pointer CCEditOverheads which probably was used to construct an instance of TCCEditOverheads  within the .cpp. if that is true, you may also find a call  to FormCreate in the source. if you never had problems in the past with that, you could check whether the call (or the whole function where it was in) was within a preprocessor conditioned block. then, i would assume the precondition had changed with your reinstallation.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now