Lniker Error while compilation.

viv_men

Usenet Archive
Joined
Jan 7, 2005
Messages
1
Reaction score
0
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
 

Victor Bazarov

Usenet Archive
Joined
Sep 27, 2000
Messages
15,278
Reaction score
0
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
 

Mike Wahler

Usenet Archive
Joined
Jun 24, 2003
Messages
3,745
Reaction score
0
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
 

slashman

Usenet Archive
Joined
Nov 5, 2004
Messages
4
Reaction score
0
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
 

Mike Wahler

Usenet Archive
Joined
Jun 24, 2003
Messages
3,745
Reaction score
0
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

No members online now.

Forum statistics

Threads
548,051
Messages
3,104,251
Members
248,135
Latest member
tobystanx

Latest Threads

Top