Subj : Re: Borland's example, but doesn't link To : borland.public.cpp.borlandcpp From : Jogy Date : Thu Jul 10 2003 11:14 am Rob C wrote: > My deepest thanks to all those who have helped me in the past. > > The following code is directly out of the computer, yet it doesn’t link. I suspect it maybe has to be compiled/linked as a project with certain settings - yet the book doesn’t tell me that. > > //---------------------------------------------------------------------------- > // ObjectWindows - (C) Copyright 1991, 1994 by Borland International > // Tutorial application -- step01.cpp > //---------------------------------------------------------------------------- > #include > #include > #include > > class TDrawApp : public TApplication { > public: > TDrawApp() : TApplication() {} > > void InitMainWindow() > { > SetMainWindow(new TFrameWindow(0, "Sample ObjectWindows Program")); > } > }; > > int > OwlMain(int /*argc*/, char* /*argv*/ []) > { > return TDrawApp().Run(); > } > > ERRORS I GET - > Info :Making... > Info :Linking C:\BC5\EXAMPLES\OWL\TUTORIAL\step01.exe > Error: Error: Unresolved external '_main' referenced from C:\BC5\LIB\C0X32.OBJ > Hello, Probably you are trying to open just step01.cpp and compile it. It is better to load the tutorial .ide file and use it, as it has all the needed settings. This .cpp is intended for a Windows 32-bit GUI program. But if you load it without a project, the default settings will be used, and they are for 32-bit Console program. You can chagne this by right-clicking on the .cpp file and selecting Target Expert. -- Jogy http://www.jogy.net/ jogy@sirma.bg .