Find the answer to your Linux question:
Results 1 to 4 of 4
I am working on a Linux embedded C++ project. When I do an install, all of the header files are copied into the target at /usr/include/. My question is, why ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2009
    Posts
    4

    Why does my installer copy *.h into /usr/include


    I am working on a Linux embedded C++ project. When I do an install, all of the header files are copied into the target at /usr/include/.

    My question is, why would the target ever need the C++ header files? It seems to me all the target needs is the executables and the library *.so files.

    I want to remove the installation of header files into the target but I'm afraid I'm missing something.

    Thanks!

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    If you're writing a library, then in your .so files, you have defined functions for the user to call. In order for the user to compile a program using those functions, they need a header file to give the interfaces to those functions.

    If you are writing an application, not a library, you may have your Makefile compiled wrong. If are writing an application, the user does not need your header files.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,596
    Post the contents of your Makefile here.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Just Joined!
    Join Date
    Sep 2009
    Posts
    4

    Smile

    There are several makefiles, scripts, etc. It is very complex.

    Now I understand the purpose of the include header files. I am building a shared library and I'm compiling against it. the shared library header files are available for the compile. However, the shared library header files are also getting installed in the embedded target. They don't need to be. I'll remove that step in the install target.

    I appreciate your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •