473,480 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

[Linker Error] Unresolved external '__fastcall TForm1::Fim_Mundo(Extctrls::TImage *)'

1 New Member
[Linker Error] Unresolved external '__fastcall TForm1::Fim_Mundo(Extctrls::TImage *)' referenced from C:\USERS\AMELIA DANIEL\DOCUMENTS\PROJECTOCG\UNIT1.OBJ
[Linker Error] Unresolved external '__fastcall TForm1::Fim_Mundo(Extctrls::TImage *)' referenced from C:\USERS\AMELIA DANIEL\DOCUMENTS\PROJECTOCG\UNIT1.OBJ
[Linker Error] Unresolved external '__fastcall TForm1::Fim_Mundo(Extctrls::TImage *)' referenced from C:\USERS\AMELIA DANIEL\DOCUMENTS\PROJECTOCG\UNIT1.OBJ



TENHO ESTE ERRO NO CÓDIGO
Expand|Select|Wrap|Line Numbers
  1. //---------------------------------------------------------------------------
  2.  
  3. #include <vcl.h>
  4. #include <fstream.h>
  5. #include <math.h>
  6. #pragma hdrstop
  7.  
  8. //variaveis da nossa estrutura do vertices
  9. struct Pontos
  10. {
  11.    int x,y,z;
  12. };
  13.  
  14. #include "Unit1.h"
  15.  
  16.  
  17. //---------------------------------------------------------------------------
  18. #pragma package(smart_init)
  19. #pragma resource "*.dfm"
  20. TForm1 *Form1;
  21.  
  22. Pontos *P1, *P2;
  23. int QtVerticesP1, QtVerticesP2;
  24.  
  25. //Fim do Mundo
  26. float XminP, XmaxP, YminP, YmaxP;
  27. float XminR, XmaxR, YminR, Ymax;
  28.  
  29. //Definir matrizes de T, R e Auxiliares
  30.  float E[3][3], T[3][3], R[3][3], MT[3][3], MAux[3][3];
  31.  
  32. //Ordem da matriz
  33. float ordem_matrizes=3;
  34.  
  35. //Coordenadas do Centro de massa
  36. float Xcm, Ycm;
  37.  
  38. //Número de Coordenação dos dois poligonos (1-> Cinza e 2->Amarelo)
  39. AnsiString  NC_Pol1 = "", NC_Pol2 = "";
  40.  
  41. void __fastcall Fim_Mundo(TImage *Im);
  42. //---------------------------------------------------------------------------
  43. __fastcall TForm1::TForm1(TComponent* Owner)
  44.         : TForm(Owner)
  45. {
  46. }
  47. //---------------------------------------------------------------------------
  48. void __fastcall TForm1::CarregarClick(TObject *Sender)
  49. {
  50. char Linha[1024];
  51. String Dados;
  52. int i;
  53. float X, Y;
  54.  
  55.        QtVerticesP1 = 3;
  56.        P1=new Pontos[QtVerticesP1];
  57.  
  58.          P1[0].x=120;
  59.          P1[0].y=30;
  60.          P1[0].z=1;
  61.  
  62.          P1[1].x= 230;
  63.          P1[1].y=90;
  64.          P1[1].z=1;
  65.  
  66.          P1[2].x= 100;
  67.          P1[2].y=160;
  68.          P1[2].z=1;
  69.  
  70.  
  71.      Desenhar_Poligono(P1,QtVerticesP1, clGray);
  72.  
  73.      //------------------- Poligono 2
  74.      QtVerticesP2 = 3;
  75.  
  76.      P2=new Pontos[QtVerticesP2];
  77.      for(i=0;i<QtVerticesP2;i++)
  78.        {
  79.  
  80.          P2[0].x=890;
  81.          P2[0].y=30;
  82.          P2[0].z=1;
  83.  
  84.          P2[1].x=900;
  85.          P2[1].y=160;
  86.          P2[1].z=1;
  87.  
  88.          P2[2].x=800;
  89.          P2[2].y=160;
  90.          P2[2].z=1;
  91.        }
  92.      Desenhar_Poligono(P2,QtVerticesP2, clYellow);
  93.  
  94.      Button2 ->Enabled = True;
  95. }
  96. //---------------------------------------------------------------------------
  97.  
  98. void __fastcall TForm1::Limpar_Area_Trabalho()
  99. {
  100.   Image1->Canvas->Pen->Color=clBlack;
  101.   Image1->Canvas->Brush->Color=clWhite;
  102.   Image1->Canvas->Rectangle(0,0,Image1->Width,Image1->Height);
  103. }
  104. //---------------------------------------------------------------------------
  105. void __fastcall TForm1::FormCreate(TObject *Sender)
  106. {
  107.    Limpar_Area_Trabalho();
  108.    Fim_Mundo(Image1);
  109.    Timer1->Enabled=False;
  110. }
  111. //---------------------------------------------------------------------------
  112. void __fastcall Fim_Mundo(TImage *Im)
  113. {
  114. XminP=0; XmaxP=Im->Width;
  115. YminP=0; YmaxP=Im->Height;
  116. XminR=0; XmaxR=Im->Width;
  117. YminR=0; YmaxP=Im->Height;
  118. };
  119. //---------------------------------------------------------------------------
  120. void TForm1::Desenhar_Poligono(Pontos *PAux, int QtV, TColor cColor)
  121. {
  122. TPoint *vertices;
  123. int i;
  124.  
  125. // Limpar_Area_Trabalho();
  126. Image1->Canvas->Brush->Color=cColor;
  127. Image1->Canvas->Pen->Color=clBlack;
  128. Image1->Canvas->Pen->Width=1;
  129.  
  130. vertices = new TPoint[QtV];
  131.  
  132. for(i=0;i<QtV;i++)
  133.   {
  134.    Image1->Canvas->Ellipse(PAux[i].x-5,PAux[i].y-5,PAux[i].x+5,PAux[i].y+5);
  135.  
  136.    vertices[i].x=PAux[i].x;
  137.    vertices[i].y=PAux[i].y;
  138.   }
  139.   Image1->Canvas->Polygon(vertices,QtV-1);
  140.  
  141. };
  142. //---------------------------------------------------------------------------
  143. void TForm1::CentroDeMassa(Pontos *PAux, int QtV)
  144. {
  145.  float TempX = 0, TempY = 0;
  146.  
  147.  for(int i=0; i<QtV; i++)
  148.  {
  149.   TempX = TempX + PAux[i].x;
  150.   TempY = TempY + PAux[i].y;
  151.  }
  152.  Xcm=TempX/QtV;
  153.  Ycm=TempY/QtV;
  154. };
  155. //---------------------------------------------------------------------------
  156. AnsiString TForm1::Determinar_NC(float px, float py, Pontos *PAux, int QtV)
  157. {
  158.  int i,j;
  159.  float x1,y1,x2,y2,m;
  160.  AnsiString NC="";
  161.  
  162.  for(int i=0; i<QtV; i++)
  163.  {
  164.   x1=PAux[i].x;
  165.   y1=PAux[i].y;
  166.  
  167.   if(i != QtV -1)
  168.   {
  169.    x2=PAux[i+1].x;
  170.    y2=PAux[i+1].y;
  171.   }
  172.   else
  173.   {
  174.     x2=PAux[0].x;
  175.    y2=PAux[0].y;
  176.   }
  177.   if(x1==x2) m=1;
  178.   else m=(y2-y1)/(x2-x1);
  179.  
  180.   if(m==1)
  181.   {
  182.    if(px>x1) NC=NC+"0";
  183.    else NC=NC+"1";
  184.   }
  185.   else
  186.   {
  187.    if((m*(x2-px)+(py-y2))>0)
  188.    NC=NC+"0";
  189.    else
  190.    NC=NC+"1";
  191.   };
  192.  } //«Fim do For
  193.  return(NC);
  194. };
  195. //---------------------------------------------------------------------------
  196. void __fastcall TForm1::Timer1Timer(TObject *Sender)
  197. {
  198. float Tx1, Ty1, Tz1, Tm;
  199.  
  200. Limpar_Area_Trabalho();
  201.  
  202. // Poligono Cinza
  203.  
  204. CentroDeMassa(P1,QtVerticesP1);
  205. Tx1 = Edit1->Text.ToDouble();
  206. Ty1 = Edit2->Text.ToDouble();
  207. Tz1=1;
  208. Tm= Edit3->Text.ToInt();
  209.  
  210. Transladar(P1,Tx1,Ty1,Tz1,QtVerticesP1);
  211. Rotar(Xcm,Ycm,1,Tm,P1,QtVerticesP1);
  212. NC_Pol1 = Determinar_NC(Xcm, Ycm, P1, QtVerticesP1);
  213. Edit7 ->Text = NC_Pol1;
  214.  
  215. //Desenhar Poligono
  216. Desenhar_Poligono(P1, QtVerticesP1, clGray);
  217.  
  218. CentroDeMassa(P2, QtVerticesP2);
  219. Tm = Edit6->Text.ToDouble();
  220. Tx1= Edit4->Text.ToDouble();
  221. Ty1=Edit5->Text.ToDouble();
  222. Tz1=1;
  223.  
  224. Transladar(P2,Tx1,Ty1,Tz1,QtVerticesP2);
  225. Rotar(Xcm,Ycm,1,Tm,P2,QtVerticesP2);
  226. NC_Pol2= Determinar_NC(Xcm,Ycm,P2,QtVerticesP2);
  227. Edit8->Text=NC_Pol2;
  228.  
  229. //Desenhar poligono
  230.  
  231. Desenhar_Poligono(P2,QtVerticesP2,clYellow);
  232.  
  233. //Chocando-se
  234.  
  235. if(Chocaram(P1,P2))
  236. {
  237. Timer1->Enabled=False;
  238. ShowMessage("Houve Choque");
  239. }
  240.  
  241.  
  242. }
  243. //---------------------------------------------------------------------------
  244. void TForm1::Formar_Mat_E(float Sx,float Sy,float Sz)
  245.  {
  246.    E[0][0]=Sx; E[0][1]=0;  E[0][2]=0;
  247.    E[1][0]=0;  E[1][1]=Sy; E[1][2]=0;
  248.    E[2][0]=0;  E[2][1]=0;  E[2][2]=1;
  249.  }
  250. //---------------------------------------------------------------------------
  251. void TForm1::Formar_Mat_T(float Tx, int Ty, float Tz)
  252. {
  253.         T[0][0]=1;    T[0][1]=0;  T[0][2]=Tx;
  254.         T[1][0]=0;    T[1][1]=1;  T[1][2]=Ty;
  255.         T[2][0]=0;    T[2][1]=0;  T[2][2]=1;
  256.  
  257. }
  258. //---------------------------------------------------------------------------
  259. void TForm1::Formar_Mat_R(float Tm)
  260. {
  261.  
  262. float Ang=Tm*M_PI/180;
  263. float S= sin(Ang);
  264. float C= cos(Ang);
  265.  
  266.         T[0][0]=C;    T[0][1]=-S;  T[0][2]=0;
  267.         T[1][0]=S;    T[1][1]=C;   T[1][2]=0;
  268.         T[2][0]=0;    T[2][1]=0;   T[2][2]=1;
  269.  
  270. }
  271. //---------------------------------------------------------------------------
  272. void TForm1::Mult_Mat(float A[3][3], float B[3][3], float C[3][3])
  273. {
  274. int i,j,k;
  275.  
  276. for(i=0;i<ordem_matrizes;i++)
  277. for(j=0;j<ordem_matrizes;j++)
  278. for(k=0;k<ordem_matrizes;k++)
  279.  
  280. C[i][j]=C[i][j]+A[i][k]*B[k][j];
  281. }
  282. //---------------------------------------------------------------------------
  283. void TForm1::Aplicar_Mat(float M[3][3], Pontos *PAux, int QtV)
  284. {
  285.  int i,j;
  286.  float Num;
  287.  Pontos *P_Resultado;
  288.  P_Resultado = new Pontos[QtV];
  289.  for(i=0;i<QtV;i++)
  290.  {
  291.   Num=0;
  292.   for(j=0;j<ordem_matrizes;j++)
  293.   {
  294.    Num=M[j][0]*PAux[i].x + M[j][1]*PAux[i].y + M[j][2]*PAux[i].z;
  295.    if(j==0) P_Resultado[i].x=Num;
  296.    if(j==1) P_Resultado[i].y=Num;
  297.    if(j==2)P_Resultado[i].z=Num;
  298.   }
  299.  }
  300.  for(i=0;i<QtV;i++)
  301.  PAux[i]=P_Resultado[i];
  302. }
  303. //---------------------------------------------------------------------------
  304. void TForm1::Inic_Matrizes_Transf()
  305. {
  306. int i,j;
  307. for(i=0;i<ordem_matrizes;i++)
  308. for(j=0;j<ordem_matrizes;j++)
  309.  {
  310.   MT[i][j]=0;
  311.   MAux[i][j]=0;
  312.  }
  313. }
  314. //---------------------------------------------------------------------------
  315. void TForm1::Rotar(float Tx,float Ty,float Tz, float Tm,Pontos *PAux, int QtV)
  316. {
  317.  Inic_Matrizes_Transf();
  318.  Formar_Mat_T(-Tx,-Ty,-Tz);
  319.  Formar_Mat_R(Tm);
  320.  Mult_Mat(R,T,MAux);
  321.  Formar_Mat_T(Tx,Ty,Tz);
  322.  Mult_Mat(T,MAux,MT);
  323.  Aplicar_Mat(MT,PAux,QtV);
  324. }
  325. //---------------------------------------------------------------------------
  326. void TForm1::Transladar(Pontos *PAux, float Tx11, float Ty22, float Tz33, int nVert)
  327. {
  328. Inic_Matrizes_Transf();
  329. Formar_Mat_T(Tx11,Ty22,Tz33);
  330. Aplicar_Mat(T,PAux,nVert);
  331. };
  332. //---------------------------------------------------------------------------
  333.  
  334.  
  335. void __fastcall TForm1::Button2Click(TObject *Sender)
  336. {
  337. Timer1->Enabled=True;
  338. }
  339. //---------------------------------------------------------------------------
  340. bool TForm1::Chocaram(Pontos *PAux1, Pontos *PAux2)
  341. {
  342.  bool Choque= false;
  343.  int i=0;
  344.  float Px, Py;
  345.  AnsiString NC_Ponto;
  346.  
  347.  while((i<QtVerticesP1) && (!Choque))
  348.  {
  349.   Px=PAux1[i].x;
  350.   Py=PAux1[i].y;
  351.   NC_Ponto=Determinar_NC(Px,Py,PAux2, QtVerticesP2);
  352.   if(NC_Pol2 == NC_Ponto)
  353.    Choque=True;
  354.     i++;
  355.  };
  356.  if(!Choque)
  357.  {
  358.   i=0;
  359.   while((i<QtVerticesP2) && (!Choque))
  360.   {
  361.    Px=PAux2[i].x;
  362.    Py=PAux2[i].y;
  363.    NC_Ponto=Determinar_NC(Px,Py,PAux1,QtVerticesP1);
  364.    if(NC_Pol1==NC_Ponto)
  365.     Choque= True;
  366.     i++;
  367.   };
  368.  };
  369.  return (Choque);
  370. };
  371. //---------------------------------------------------------------------------
Nov 1 '19 #1
1 1646
dev7060
639 Recognized Expert Contributor
- Posted code is incomplete. The code includes a custom header file "Unit1.h".
- Use code tags.
- Explain what the code is about (in English).
- Mention the environment details (OS/IDE/Compiler).
Nov 2 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1673
by: Jim | last post by:
All, I'm trying to debug a Python GPF while running a script that we've written. After fixing up some of the paths for the Python build and successfully building Python from ActiveState source,...
5
8424
by: Yoon-Soo Lee | last post by:
I am using Visual C++ .NET 2003 and running into some linking error from the following template code. The error messages is error LNK2019: unresolved external symbol "class...
1
8390
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
1
4955
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
0
1051
by: patrick | last post by:
Hello, I'm trying to work on an old project started off on MSVC 5 and continue now with MSVC 6. Importing works fine, also the compilation goes well without warnings or errors. Unfortunately...
4
29294
by: yOtA | last post by:
I get this Linker Errors while compiling my program: Error: Unresolved external 'vminit()' referenced from C:\TESTE\TESTE.OBJ Error: Unresolved external 'vmalloc(void *, int, unsigned int,...
2
2268
by: iwl | last post by:
Hello I copied the code from the Extending Embedded Python section in the Python 2.5 but get an linker Error Unresolved external _Py_InitModule4TraceRefs. Who knows what's wrong?
4
1742
by: timon | last post by:
Hello! i´m trying to run a project in c++ Builder (windos) that uses assembly code. i assembly the code with ml.exe, then i have a .obj i add this .obj to the project then in a .cpp i write ...
4
4069
by: AceKnocks | last post by:
Hi all, I have these two classes with following structure //main.cpp class Tree { public: static bool flag; Tree() {
1
4581
by: david tran | last post by:
Hello, I was compiling a project, and this project has a unit called Gamespaceframe, the header file was as follow: : #include "Advdgrid.hpp" : and the .cpp was as follow:
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4471
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.