GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Jul-2003, 13:56
Charunks Charunks is offline
New Member
 
Join Date: Jul 2003
Posts: 4
Charunks is an unknown quantity at this point
Unhappy

a noobish compiler question


Hi all,

I've got a question. I've got the borland 5.5 compiler. I've tried to compile for the first time using this ccp script (hello.ccp):

CPP / C++ / C Code:
#include <iostream.h>

int main ()
{
 cout << "Hello World!\n";
 return 0;
}

when I try to compile using the borland compiler I get this error:

Fatal F1003 C:borland\bcc55\Include\stdcomp.h 5: error directive: must use C++ for STDCOMP.H
*** 1 errors in compile ***

can anyone tell me what I do wrong, or what I should do?

thnx
  #2  
Old 14-Jul-2003, 02:54
Garth Farley Garth Farley is offline
Awaiting Email Confirmation
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
It's amazing what a quick Google can do. Read this:

bdn.borland.com

C++ filenames, by convention, end with .cpp. Yours ends with ccp. Change it, and it should compile ok.

Garth Farley
  #3  
Old 14-Jul-2003, 02:56
Garth Farley Garth Farley is offline
Awaiting Email Confirmation
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
And Welcome to the Boards, Charunks!

Apologies, I'm just back at work, Monday morning. Headache already It's gonna be a long day.

GF
  #4  
Old 02-Sep-2003, 18:53
djm2084 djm2084 is offline
New Member
 
Join Date: Sep 2003
Posts: 1
djm2084 is an unknown quantity at this point
I am also having the same error message and my file extension is .cpp.

I have two files logbook.cpp and logbook.h that I am trying to compile but I get the Need to use C++ for stdcomp.h error message.

Any thoughts?
  #5  
Old 02-Sep-2003, 22:58
Dariklar Dariklar is offline
New Member
 
Join Date: Sep 2003
Location: Illinois
Posts: 9
Dariklar is on a distinguished road

Borland ...


hmm not sure if the borland compiler requires it or not, but for my visual C++ compiler, I need to put
using namespace std;
after #include <iostream>
so your program would look like
CPP / C++ / C Code:
#include <iostream>
using namespace std;
int main()
{
    cout << "Hello world!\n";
return 0;
}
__________________
Dariklar, 63 human monk
Migboaf, 64 dwarvish cleric
Xegony, EverQuest.
http://dariklar.googlepages.com
  #6  
Old 03-Sep-2003, 02:18
Garth Farley Garth Farley is offline
Awaiting Email Confirmation
 
Join Date: May 2002
Location: Ireland
Posts: 638
Garth Farley is a jewel in the roughGarth Farley is a jewel in the roughGarth Farley is a jewel in the rough
Using namespace usually depends on the compiler. Some are smart enough to guess what you're thinking, others are not.

It's good to use it, especially when you understand why.
GF
 
 

Recent GIDBlogCompress Your Web Site by gidnetwork

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
-- Dumb Com Port Question -- jetpilot8 Computer Hardware Forum 0 02-Dec-2003 17:08
a C input question.. tmike C Programming Language 2 19-Sep-2003 02:39
a C input question tmike C Programming Language 1 16-Sep-2003 02:31
i need a free Mac compiler yerdos C++ Forum 1 28-Jul-2003 02:12
CSS Layout question oihjk Web Design Forum 3 28-May-2003 11:36

Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 14:11.


vBulletin, Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.