-
December 14th, 2010, 01:02 PM
#1
[n00b question] How to compile without havin header files
Hi,
I'm very new at C++ but I'm learning it.. I also could write my first simple programs with variables etc. My only question is how to compile sources without the .h files? I mean when I download game sources and other sources from Source Sites on the WWW there is mostly only the .ccp file with the main source code but no header files.. how to compile something like that??
Thanks
annonym/n00b
-
December 14th, 2010, 01:58 PM
#2
Re: [n00b question] How to compile without havin header files
-
December 14th, 2010, 02:19 PM
#3
Re: [n00b question] How to compile without havin header files
A lot of the needed headers come with the compiler. If additional ones are needed you have to download that package/library as well.
-
December 14th, 2010, 02:22 PM
#4
Re: [n00b question] How to compile without havin header files
Your question doesn't make a whole lot of sense. You can't compile a program unless you have all the files it needs. Which header files are you referring to? Standard library files, or header files that are part of the source you download?
-
December 14th, 2010, 03:18 PM
#5
Re: [n00b question] How to compile without havin header files
In rare cases, you may be able to link in libraries originally built in a different language by forward-declaring the symbols from them that you need to use. For instance, you could do this to link a C program against a FORTRAN implementation of LAPACK. However, you need to be very careful that the calling convention is compatible, and the interpretation of the data on the other end is what you expect. In the above example, for instance, the FORTRAN library would interpret any passed matrices as column-major while C would see them as row-major.
-
December 15th, 2010, 05:29 AM
#6
Re: [n00b question] How to compile without havin header files
The project header files you can deduce from cpp files though you may encounter problems if they used inline functions or multiple inheritance or inheritance from non-project classes where you have no sources at all.
The header files from runtime llibraries or third party you might get from the web.
I would say for non-trivial programs it isn't worth the efforts cause you necessarily will experience parts in the source which cannot be used without the original header files.
I think it would be better you would try to ask the author of the sources to send you the missing sources. That probably is only fair.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|