"Hello World" project for borland c++

I tried the available source code for the Hello World console project and none works.
My textbook lists this for the Hello World program.

#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World.";
return 0;
}

I'm not sure if this will help you or not, but it worked for me. I'm using Visual Studio 2010.
Note the title, I mentioned "Borland c++". Just tested and it return errors on BC++.
What errors? Post your source as well.
I missed that. I'm sorry I couldn't help.
I tested the source code provided on this site and here.
http://www.learncpp.com/cpp-tutorial/06-writing-your-first-program/

Code:
1
2
3
4
5
6
7
8
9
//---------------------------------------------------------------------------

#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World.";
return 0;
}


Error:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Checking project dependencies...
Compiling Project1.cbproj (Debug, Win32)
ilink32 command line
  c:\program files (x86)\embarcadero\rad studio\8.0\bin\ilink32.exe -L.\Debug\Win32;"c:\program files (x86)\embarcadero\rad studio\8.0\lib\Win32\debug";
  "c:\program files (x86)\embarcadero\rad studio\8.0\lib\Win32\release";"c:\program files (x86)\embarcadero\rad studio\8.0\lib\win32\release\psdk";
  "C:\Program Files (x86)\Raize\CS4\Lib\RS-XE";"c:\program files (x86)\embarcadero\rad studio\8.0\RaveReports\Lib";"C:\Users\Public\Documents\RAD 
  Studio\8.0\DCP" -j.\Debug\Win32;"c:\program files (x86)\embarcadero\rad studio\8.0\lib\Win32\debug";"c:\program files (x86)\embarcadero\rad 
  studio\8.0\lib\Win32\release";"c:\program files (x86)\embarcadero\rad studio\8.0\lib\win32\release\psdk";"C:\Program Files (x86)\Raize\CS4\Lib\RS-XE";
  "c:\program files (x86)\embarcadero\rad studio\8.0\RaveReports\Lib";"C:\Users\Public\Documents\RAD Studio\8.0\DCP" -l.\Debug\Win32 -v -V5.0 -G8 -Tpe  
  c0x32w rtl.bpi vcl.bpi memmgr.lib sysinit.obj .\Debug\Win32\File1.obj , .\Debug\Win32\Project1.exe , .\Debug\Win32\Project1.map , import32.lib 
  cp32mti.lib , , 
[ILINK32 Error] Error: Unresolved external '__InitVCL' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\8.0\LIB\WIN32\RELEASE\CP32MTI.LIB|crtlvcl
[ILINK32 Error] Error: Unresolved external '__ExitVCL' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\8.0\LIB\WIN32\RELEASE\CP32MTI.LIB|crtlvcl
[ILINK32 Error] Error: Unresolved external '_wmain' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\RAD STUDIO\8.0\LIB\WIN32\RELEASE\C0X32W.OBJ
[ILINK32 Error] Error: Unable to perform link
Failed
Elapsed time: 00:00:00.2
Last edited on
Anyone? I really want to proceed with learning c++.
Hey hitcode I couldn't find anything or figure out what's going on with your computer;

try installing a different compiler?

I'm currently using wxdev C++

you could also try codeblocks or visual studio express
Eh, not sure. i guess i'll use VS 2010 instead. I heard BC++ is better, that's why I'm using it.
Update: installed VS 2010, compiled, debugged and worked. I just hoke VS++ won't lack features BC++ offers.
Well, BCB has always been without peer in terms of easy GUI application development (at least when it was still from Borland, I don't know about now). That's more or less its only strength, though.
try this > v "normal C"
1
2
3
4
5
6
#include <stdio.h>
int main (void);
{
printf("hello world !");
return 0;
}


Well, all those errors seem to be in regards to a Windows Application (wmain and whatnot). I've never used Borland, but with VC, you need to make sure you're making a console or blank application.
The problem is that you are trying to compile as a VCL application (Windows GUI) when your Hello World program is a console application.

Start a New Project and select "Console Application".

Paste your code in, save, and compile. (Make sure you save it somewhere other than the default spot. For example, all my C and C++ programming stuff is in subdirectories of "D:\prog\cc".

Open the command interpreter via Start->Programs->Accessories->Command Prompt, or just type "cmd" in the Run Program dialogue. Use the cd command to change to your new executable's directory (which you should have created above in step two). Run the program. Example:
C:> d:
D:> cd prog\cc\hello\release
D:\prog\cc\hello\release> hello


You can also have the IDE run the program for you, but then you'll have to add something to keep the command window open long enough to see that the program executed properly. See this topic:
http://www.cplusplus.com/forum/articles/7312/

Hope this helps.
Last edited on
Topic archived. No new replies allowed.