Lniker Error while compilation.

V

viv_men

hi,
i have implemented a base class and a derived class as follows
base : beziertriangle .h and beziertriangle .cpp
derived: PNpatch.h and PNpatch.cpp

when i compile them it works out fine , but when i create an instance
of the derived class in its main function, it gives my a linker error
of the form

(i'm using the borland complier)
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
PNpatch.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'beziertriangle::~beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
Error: Unresolved external 'beziertriangle::beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
i'm not really sure what the problem is...

thanks
vivek
 
V

Victor Bazarov

i have implemented a base class and a derived class as follows
base : beziertriangle .h and beziertriangle .cpp
derived: PNpatch.h and PNpatch.cpp

when i compile them it works out fine , but when i create an instance
of the derived class in its main function, it gives my a linker error
of the form

(i'm using the borland complier)
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
PNpatch.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'beziertriangle::~beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
Error: Unresolved external 'beziertriangle::beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
i'm not really sure what the problem is...

Make sure you include 'beziertriangle.obj' when linking. Also, consider
asking linking and other project management questions in the compiler NG.

V
 
M

Mike Wahler

hi,
i have implemented a base class and a derived class as follows
base : beziertriangle .h and beziertriangle .cpp
derived: PNpatch.h and PNpatch.cpp

when i compile them it works out fine , but when i create an instance
of the derived class in its main function, it gives my a linker error
of the form

(i'm using the borland complier)
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
PNpatch.cpp:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'beziertriangle::~beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
Error: Unresolved external 'beziertriangle::beziertriangle()'
referenced from C:\CPLUS\PNPATCH.OBJ
i'm not really sure what the problem is...

It's impossible for anyone to say for sure without seeing
your code. But it looks like you've failed to provide
implementations for your 'beziertriangle' constructor
and destructor.

Post the mimimum amount of code that produces the errors.

-Mike
 
S

slashman

hi,
the constructor and destructor were in the beziertriangle.cpp file,
when i moved them to the .h file the compliation worked just fine...
so i'm guesing Victor was right and i need to include the obj files...
thanks for the input guys
vivek
 
M

Mike Wahler

slashman said:
hi,
the constructor and destructor were in the beziertriangle.cpp file,
when i moved them to the .h file the compliation worked just fine...
so i'm guesing Victor was right and i need to include the obj files...

Yes, it appears you didn't give your linker all the inputs
it needed.
thanks for the input guys

You're welcome.

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top