Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

no appropriate default constructor available

Status
Not open for further replies.

Athanasopolous

Programmer
Jun 25, 2005
40
US
What causes the

no appropriate default constructor available

linker error

when I do have an constructor defined in the header file?

It is a link error

It is an unresolved external symbol for the constructor

LNK2019: unresolved external symbol "public: __thiscall CSomething::CSomething(class CSomethingelse *)



and yet in the header file I have the constructor set up for that as:

CSomething( CSomethingelse * psomethingelse)



Which is how it is used in the cpp file.
 
If you declare it in the header file, you also need to implement it in the .cpp file, otherwise the linker can't find the code that goes with the constructor signature.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top