| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Can you compile a h-file? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|