Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

THOSE ERROR MESSAGE ABOUT?

Posted on 2000-03-19
3
Medium Priority
?
335 Views
Last Modified: 2006-11-17
I JUST USE THE C++ BUILDER 4.0.
MY SOURCE IS:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TChart::TDBChart *dbc=new TDBChart();

dbc->Assign(DBChart1->Picture->Bitmap);

// TJPEGImage ¤º©wªºÀ£ÁY²v¬O90%
dbc->CompressionQuality=(short)Edit1->Text.ToInt();

dbc->SaveToBitmapFile("Test.bmp");

//±N¦sªºJPG¹ÏŪ¨ìImage2
// JPG->LoadFromFile("test.jpg");

// Image2->Picture->Bitmap->Assign(JPG);

delete dbc;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
if (CheckBox1->Checked)
   DeleteFile("Test.bmp");
}

THE ERROR MESSAGE IS:
[C++ Error] TEST.cpp(18): E2451 Undefined symbol 'TDBChart'.
[C++ Error] TEST.cpp(18): E2451 Undefined symbol 'dbc'.
[C++ Error] TEST.cpp(18): E2285 Could not find a match for 'TDBChart::TDBChart()'.
[C++ Error] TEST.cpp(20): E2316 'Picture' is not a member of 'TDBChart'.
[C++ Error] TEST.cpp(23): E2451 Undefined symbol 'Edit1'.
[C++ Error] TEST.cpp(32): E2158 Operand of 'delete' must be non-const pointer.
THOSE ERROR ABOUT WHAT?
THANK YOU!

0
Comment
Question by:erichuang
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 2635408
Hi erichuang,

I found at least one failure:

If TDBChart is declared in namespace of TChart, then
TChart::TDBChart *dbc=new TDBChart();
should be:
TChart::TDBChart *dbc=new TChart::TDBChart();

this should solve the first three and the last error.

the other errors seem to be declaration errors.
Unfortunately I'm not experienced with C++ builder, so I don't know the TDBChart class at all...

ZOPPO
0
 

Accepted Solution

by:
amador earned 320 total points
ID: 2639808
1 - the compilator cant find the obj TDBChat
2 - Consequence of 1
3 - He cant find the constructor TDBChart in obj TDBChart, if TDBChart is derived for TChart, put TChart:: before.
4 - He cant finda the function Picture in TDBChart, see 3
5 - Verify if Edit1 is declared, or if it is the name of the object really.
6 - Consequence of 1.

TChart::TDBChart *dbc= (TDBChart *) new TChart::TDBChart();

Test pointer before: if (dbc == NULL) return;

0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2639894
Hi amador,

some comments:

>if TDBChart is derived for TChart, put TChart:: before.
derived??? I would say TDBChart is declared in namespace TChart, i.e. a 'subclass' of TChart...

>He cant finda the function Picture in TDBChart
From the code I would say 'object Picture' instead of 'function Picture'

>TChart::TDBChart *dbc= (TDBChart *) new TChart::TDBChart();
why use that extra cast (which will not work until you cast to (TCart::TDBChart*)new... ), it's not needed

ZOPPO
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question