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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newb question about object and c ++ builder....

Status
Not open for further replies.

lobodo44

Technical User
Sep 8, 2003
27
CA
Yes I'm posting another noob question about object it's because I'm really new to that programming ( c++ visual and form). So when I try to execute my program it always say to me : 'Unresolved external 'TForm1::myconst' referanced from 'c:/.../file.obj'. I'm sure it's a little thing that I don't know that must be done or anything.

 
It sounds like you've declare the variable 'myconst' as extern.

If this is so, then before you use the variable in file.cpp you must also declare it there.

e.g.

In TForm1.h
============
extern int myconst = 10;

In file.h or at the top of file.cpp
====================================
extern int myconst; // Links to one above

In file.cpp
============
int a = myconst; // Should be ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top