C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 20th, 2004, 10:05 PM
jeffe jeffe is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 jeffe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can you compile a h-file?

Hi,
I'm realy a newbie, so sorry if I ask stupid questions...

But can you compile a h-file because Virtual C++ 6.0 tells me he can't.
The c++-code is in it and its rather big so I don't wont to put it in a separate cpp-file
(they've told me this would be no problem but...)

Thx Jeffe.

I'm using windows XP.

Reply With Quote
  #2  
Old December 21st, 2004, 02:14 AM
marmo marmo is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 37 marmo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 15 m 20 sec
Reputation Power: 4
You cannot compile a header file standalone. If thats the file with all your code in it why dont you just rename it to a .cpp file extension then compile it. You don't have to split it into a .h and a .cpp if you dont want to but you need a .cpp somewhere with your main function in it.

Reply With Quote
  #3  
Old December 21st, 2004, 03:43 PM
jeffe jeffe is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 2 jeffe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
very weird, because I've got a library made by a computer scientist of our local university and he almost always uses h-files(which are sometimes extended with a cpp-file)

Now he works on Linux and I on windows so I'm converting everything to build a usable dll and it only gives stupid errors like std::max() (EDIT: -> solved it by using stlport(www.stlport.org)) doesn't exists etc...

realy not nice but i'm getting there.. thanks for the help anyway, wil try to rename it.

Just one stupid question left then:
I suppose I'll have to change the include="file.h" to include="file.cpp" too then,no?

thx Jeffe.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Can you compile a h-file?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway