![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 3
![]() |
Hello there!
I found this cool forum under google... now I'm going post my first thread... so be nice... Well, I get tired of DevC++ craches and bugs and start using a monster IDE like Borland C++ Builder 6... I'm making a basic program in the console mode, with classes and stuff... But when I try to compile the prog, the compiler gives me the folowing messages: [Linker Error] Unresolved external 'Data::~Data()' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Trabalhador::~Trabalhador()' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Pessoa::~Pessoa()' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::~Chefe()' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Data::Data()' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Data::Data(unsigned int, unsigned int, unsigned int)' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Trabalhador::Trabalhador(char *, char *, unsigned int, Data&)' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Trabalhador::setSalario(float)' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::Chefe(char *, char *, unsigned int, Data&)' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::add(Pessoa&)' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::getFullInfo() const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Pessoa::getFullInfo() const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Trabalhador::getFullInfo() const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Trabalhador::getSalario() const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::getSalario() const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ [Linker Error] Unresolved external 'Chefe::exists(Pessoa&) const' referenced from D:\AULAS\2ANO\1SEMESTRE\PP1\AULA6\MAIN.OBJ In the help of Builder says this: Unresolved external symbol referenced from module The named symbol is referenced in the given module but is not defined anywhere in the set of object files and libraries included in the link. Check to make sure the symbol is spelled correctly. You will usually see this error from the linker for C or C++ symbols if any of the following occur: You did not properly match a symbol’s declarations of __pascal and __cdecl types in different source files. You have omitted the name of an object file your program needs. You need to manually add all required packages to the Requires list. You did not link in the emulation library. If you are linking C++ code with C modules, you might have forgotten to wrap C external declarations in extern “C”. You could also have a case mismatch between two symbols. But don't understand mutch of this... :eek: Help please!!! Thanks. ![]() |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Apr 2005
Posts: 218
Rep Power: 4
![]() |
How about you show us the original source code
|
|
|
|
|
|
#3 |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 134
Rep Power: 3
![]() |
Posting the code would be a waste. It's a linker error. That means you made prototypes for functions you never defined a body for, not all the proper .cpp and .h files are being included in the project for compilation, or not all the needed libraries are being included into the project.
|
|
|
|
|
|
#4 |
|
Programmer
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 3
![]() |
I have my classes prototypes in files ".h" and the implementation in ".cpp" files...
How do I add then to the project? |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 3
![]() |
Thanks for the quickkkkkkkk replay!!!
This is main.cpp #include <iostream>
#include "Pessoa.h"
#include "Data.h"
#include "Trabalhador.h"
#include "Chefe.h"
using namespace std;
int main()
{
Data hoje; Data d1(12,12,1990); Data d2(12,12,1980);
Chefe chefe_sec ("Paulo", "Santos", 40, d1);
chefe_sec.setSalario(300);
Trabalhador motorista("Hugo", "Mota", 25, hoje);
motorista.setSalario(150);
Trabalhador ajudante("Ana", "Ferreira", 20, hoje);
ajudante.setSalario(100);
Trabalhador secretaria("Maria", "Ferreira", 15, hoje);
secretaria.setSalario(80);
chefe_sec.add(motorista);
chefe_sec.add(ajudante);
Chefe chefe_dep ("Ernesto", "Pereira", 40, d2);
chefe_dep.setSalario(800);
chefe_dep.add(secretaria);
chefe_dep.add(chefe_sec);
chefe_dep.getFullInfo();
Chefe chefe_dep2 = chefe_dep;
system("PAUSE");
return 0;
}Do you need the classes to? |
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Oct 2005
Posts: 134
Rep Power: 3
![]() |
|
|
|
|
|
|
#7 |
|
Programmer
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 3
![]() |
Well I solve my problem...
I add the other cpp files under the menu Project-Add to Project, and the linker error messages are gone But when I run the prog, it stops sayind that the prog needs the files "stlpmt45.dll" and "CC3260MT.DLL"... :mad: I realized that files are in the "bin" directory of builder instalation... If I copy them to the directory of the project, the prog runs fine... Any way to solve this... Thanks again for the fast reply ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|