Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 27th, 2005, 6:06 PM   #1
-=PARADOX=-
Programmer
 
-=PARADOX=-'s Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 4 -=PARADOX=- is on a distinguished road
Question Borland C++

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.
-=PARADOX=- is offline   Reply With Quote
Old Oct 27th, 2005, 6:18 PM   #2
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
How about you show us the original source code
zorin is offline   Reply With Quote
Old Oct 27th, 2005, 6:23 PM   #3
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
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.
Kaja Fumei is offline   Reply With Quote
Old Oct 27th, 2005, 6:23 PM   #4
-=PARADOX=-
Programmer
 
-=PARADOX=-'s Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 4 -=PARADOX=- is on a distinguished road
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=- is offline   Reply With Quote
Old Oct 27th, 2005, 6:26 PM   #5
-=PARADOX=-
Programmer
 
-=PARADOX=-'s Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 4 -=PARADOX=- is on a distinguished road
I have my classes prototypes in files ".h" and the implementation in ".cpp" files...

How do I add then to the project?
-=PARADOX=- is offline   Reply With Quote
Old Oct 27th, 2005, 6:29 PM   #6
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
http://mechatronics.mech.northwester...a_project.html
Kaja Fumei is offline   Reply With Quote
Old Oct 27th, 2005, 6:45 PM   #7
-=PARADOX=-
Programmer
 
-=PARADOX=-'s Avatar
 
Join Date: Oct 2005
Location: Portugal
Posts: 53
Rep Power: 4 -=PARADOX=- is on a distinguished road
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
-=PARADOX=- is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:19 PM.

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