(Need Help) Codegear Rad Studio C++ Extern Problem ( Unresolved extarnal symbol )

Discussion in 'C++' started by Skrillex, Jan 30, 2013.

  1. Skrillex

    Skrillex New Member

    Joined:
    Jan 30, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    My Problem : If no value is symbol error does not. But I change value is symbol Error found


    Error:

    Code:
    
    [ILINK32 Error] Error: Unresolved external '_Symbol1' referenced from D:\Test1Project\DEBUG\UNIT1.OBJ
    [ILINK32 Error] Error: Unresolved external '_Ex' referenced from D:\Test1Project\DEBUG\UNIT1.OBJ
    
    

    PublicSymbols.h

    Code:
    
    DWORD Symbol1 = 0;
    
    struct mStruct1
    	{
    		int Lvc;
    		int cSnum;
    		String Pfq;
    		DWORD cID;
    	}Ex[25];
    
    

    Unit1.cpp

    Code:
    
    
    #include <vcl.h>
    #pragma hdrstop
    #include "Unit1.h"
    
    #include <tchar.h>
    #include <windows.h>
    #include <math.h>
    #include <iostream>
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TForm1 *Form1;
    
    extern Symbol1;
    
    extern struct mStruct1
    	{
    		int Lvc;
    		int cSnum;
    		String Pfq;
    		DWORD cID;
    	}Ex[25];
    
    
    __fastcall TForm1::TForm1(TComponent* Owner)
    	: TForm(Owner)
    {
    }
    
    void __fastcall TForm1::FormShow(TObject *Sender)
    {
    Symbol1 = 300000;
    Ex[0].Lvc = 1;
    Ex[0].cSnum = 15;
    Ex[0].Pfq = "Test";
    Ex[0].cID = Ex[0].cSnum * Symbol1;
    }
    //---------------------------------------------------------------------------
    
    
    
    
    Unit2.cpp

    Code:
    
    //---------------------------------------------------------------------------
    
    #include <vcl.h>
    #pragma hdrstop
    
    #include "Unit2.h"
    
    //---------------------------------------------------------------------------
    #pragma package(smart_init)
    #pragma resource "*.dfm"
    TForm2 *Form2;
    
    extern Symbol1;
    
    extern struct mStruct1
    	{
    		int Lvc;
    		int cSnum;
    		String Pfq;
    		DWORD cID;
    	}Ex[25];
    //---------------------------------------------------------------------------
    __fastcall TForm2::TForm2(TComponent* Owner)
    	: TForm(Owner)
    {
    }
    //---------------------------------------------------------------------------
    void __fastcall TForm2::Button1Click(TObject *Sender)
    {
    Symbol1 = 600000;
    Ex[1].Lvc = 4;
    Ex[1].cSnum = 5;
    Ex[1].Pfq = "Test5";
    Ex[1].cID = Ex[1].cSnum * Symbol1;
    
    }
    //---------------------------------------------------------------------------
    
    void __fastcall TForm2::Button2Click(TObject *Sender)
    {
    ShowMessage((String)Ex[0].Lvc + "\n" + (String)Ex[0].cSnum + "\n" + Ex[0].Pfq + "\n" + (String)Ex[0].cID);
    }
    //---------------------------------------------------------------------------
    
    
    

    Thanks to all messages, Please Help me
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice