Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Borland C++ (http://www.programmingforums.org/showthread.php?t=6669)

-=PARADOX=- Oct 27th, 2005 5:06 PM

Borland C++
 
Hello there! :cool:

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!!! :confused:

Thanks. ;)

zorin Oct 27th, 2005 5:18 PM

How about you show us the original source code

Kaja Fumei Oct 27th, 2005 5:23 PM

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.

-=PARADOX=- Oct 27th, 2005 5:23 PM

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?

-=PARADOX=- Oct 27th, 2005 5:26 PM

I have my classes prototypes in files ".h" and the implementation in ".cpp" files...

How do I add then to the project?

Kaja Fumei Oct 27th, 2005 5:29 PM

http://mechatronics.mech.northwester...a_project.html

-=PARADOX=- Oct 27th, 2005 5:45 PM

Well I solve my problem... :rolleyes:

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... :confused:

Any way to solve this...

Thanks again for the fast reply :cool:


All times are GMT -5. The time now is 4:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC