CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: header files online database

  1. #1
    Join Date
    Jul 2020
    Posts
    25

    header files online database

    I would like to run quite old C code which requires file headers as follows:

    #include "nrutil.h
    #include "nr.h"
    #include "general.h"
    #include "other.h"
    #include "memory.h"
    #include "experimental.h"
    #include "corrinfo.h"

    Is there any good online database where I could download such files from?
    Thank you.

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,320

    Re: header files online database

    I quick internet search for the first one shows it is available from codeforge

    headers such as general.h, other.h are likely to be specific to a particular program. I doubt these are available elsewhere.

    memory.h is too generic a name to know to which it refers. There is memory.h as part of LLVM - but that's c++ code.

    If you have the c code, aren't the headers available as well?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.8.2)

  3. #3
    Join Date
    Jul 2020
    Posts
    25

    Re: header files online database

    Thank you for your last post, I managed to get the complete code with its original header files from the authors.

    Could I ask you to recover that attached C code, it was written about 20years ago in environment I do not know. It produces many errors in MSVC2019. I would prefer to have it running in modern environment, I hope it will not be a huge problem to remove these, I believe, simple errors. The main file is corrinfo.c. If possible, could you pls write a short comments how the errors were removed, I would like to learn how to remove such errors
    Thank you very much for your help.

    -----------------------------
    The software we worked at the summer (cmath/gsl) is successfully analysing the data all the time now.
    Attached Files Attached Files

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,320

    Re: header files online database

    The header files are just that - headers. They don't have the associated source code for the declared functions (ie for the functions declared in nrutil.h). To get this code to compile you either need the code for these functions (eg nrutil.c)- or correct import .lib file(s).
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.8.2)

  5. #5
    Join Date
    Oct 2020
    Posts
    6

    Re: header files online database

    Lots of errors. Many undefined types: What is "vector" in pure C code for example?

  6. #6
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,320

    Re: header files online database

    vector is a C++ container. If you have reference to a vector in C code, then you'll need to obtain the definition as it probably won't be the same/have the same interface as the C++ one.

    You could probably reverse engineer one from its usage - but that's not a minor thing to do.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.8.2)

  7. #7
    Join Date
    Oct 2020
    Posts
    6

    Re: header files online database

    Quote Originally Posted by 2kaud View Post
    vector is a C++ container
    Yes, undefined in pure C code as I said/asked.

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)