GUI compliation problem in borland

N

NathanAllen

First of all to let you know I am using the following compiler:
Borland C++Builder 5.5.1 with Turbo Incremental Link 5.00

When I tried to make my first GUI drawing following Lawernceville Press's
book it created an error in the compliation process:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

E:\Gui.cpp:
Warning W8004 E:\borland\Include\lvp\String.cpp 106: 'len' is assigned a
value that is never used in function String::eek:perator =(const char *)
Warning W8057 E:\Gui.cpp 23: Parameter 'x' is never used in function
GuiClass::GuiMouseClick(int,int)
Warning W8057 E:\Gui.cpp 23: Parameter 'y' is never used in function
GuiClass::GuiMouseClick(int,int)
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_main' referenced from
E:\BORLAND\LIB\C0X32.OBJ

The warnings are no problem but the error stops the process and I can't
get an executable.

Here is the program code it's pretty simple:

#include <lvp\gui_top.h>

class GuiClass {
public:
GuiClass();
void GuiMouseClick(int x,int y);
void GuiPaint();
String Title();
private:
};

GuiClass::GuiClass()
{
}

String GuiClass::Title()
{
return("A mimimal Gui Program");
}

void GuiClass::GuiMouseClick(int x,int y)
{
}

void GuiClass::GuiPaint()
{
Circle(180,200,50);
Circle(250,200,50);
Circle(320,200,50);
Circle(215,270,50);
Circle(285,270,50);
}

#include <lvp\gui_bot.h>
 
P

Phlip

NathanAllen said:
Error: Unresolved external '_main' referenced from
E:\BORLAND\LIB\C0X32.OBJ

Prep any question to a newsgroup by searching for its details on
http://groups.google.com first. You might answer the question, and you might
learn the newsgroups where it's on topic. This newsgroup is not qualified to
answer questions about programs that don't start with main(), because we try
to be platform-neutral here.
 
R

Richard Herring

Phlip said:
Prep any question to a newsgroup by searching for its details on
http://groups.google.com first. You might answer the question, and you might
learn the newsgroups where it's on topic. This newsgroup is not qualified to
answer questions about programs that don't start with main(), because we try
to be platform-neutral here.

His program _does_ start with main (or rather it doesn't, and that's the
problem.) The underscore is just linker decoration which appears in the
error message. His problem's simple enough - main() isn't defined.
 
T

Thomas Matthews

NathanAllen said:
First of all to let you know I am using the following compiler:
Borland C++Builder 5.5.1 with Turbo Incremental Link 5.00

When I tried to make my first GUI drawing following Lawernceville Press's
book it created an error in the compliation process:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland

E:\Gui.cpp:
Warning W8004 E:\borland\Include\lvp\String.cpp 106: 'len' is assigned a
value that is never used in function String::eek:perator =(const char *)
Warning W8057 E:\Gui.cpp 23: Parameter 'x' is never used in function
GuiClass::GuiMouseClick(int,int)
Warning W8057 E:\Gui.cpp 23: Parameter 'y' is never used in function
GuiClass::GuiMouseClick(int,int)
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_main' referenced from
E:\BORLAND\LIB\C0X32.OBJ

The warnings are no problem but the error stops the process and I can't
get an executable.

Here is the program code it's pretty simple:

#include <lvp\gui_top.h>

class GuiClass {
public:
GuiClass();
void GuiMouseClick(int x,int y);
void GuiPaint();
String Title();
private:
};

GuiClass::GuiClass()
{
}

String GuiClass::Title()
{
return("A mimimal Gui Program");
}

void GuiClass::GuiMouseClick(int x,int y)
{
}

void GuiClass::GuiPaint()
{
Circle(180,200,50);
Circle(250,200,50);
Circle(320,200,50);
Circle(215,270,50);
Circle(285,270,50);
}

#include <lvp\gui_bot.h>

The above is just a class and its methods.
You need to write a program that exercises the
above class and its methods.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
C

Christopher Benson-Manica

His program _does_ start with main (or rather it doesn't, and that's the
problem.) The underscore is just linker decoration which appears in the
error message. His problem's simple enough - main() isn't defined.

<ot degree="severe">Actually, his *real* problem is likely that he's
trying to use 5.5.1 to compile an application that expects to have all
Borland's GUI crap available. In any case, if he's compiling a GUI
application, he needs to define WinMain and not main, and link against
C0W32.obj.</ot>
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top