CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2010

    Unhappy [n00b question] How to compile without havin header files


    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??


  2. #2
    Join Date
    Apr 2008

    Re: [n00b question] How to compile without havin header files

    with difficulty.

  3. #3
    Join Date
    Oct 2006

    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.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here

    Get your free MS compiler here

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003

    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?

  5. #5
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Seattle, WA

    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.

  6. #6
    Join Date
    Oct 2009

    Smile 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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.