Re: resolving linker errors





Igor Tandetnik schrieb:
<pauldepstein@xxxxxxx> wrote in message
news:08f88d7a-93b6-41c1-a846-5c46db359e81@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
The #include
"somefile.h" statements already tell the compiler to compile the
necessary h files. Therefore, what are the practical reasons (if any)
to add the included .h files to the solution so that they are visible
in solution explorer?

Purely convenience in locating and opening them. You can remove them from the solution, and the project would still compile.

It would still compile, but maybe not compile "enough". Putting the header files into the solution puts them under control of the IDE. That means they are checked out of source control when you modify them, and the make process will monitro changes on the files and automatically recompile all dependend source files.

As far as I know, only files that are part of the workspace are included in the build dependency tree. If you do not add the headers, changes in these headers might not cause the moduels using the header to be recompiled.

Norbert

In fact, your project likely uses lots of .h files that are not listed in the Solution Explorer - standard library headers, Windows headers, perhaps third-party libraries.
.



Relevant Pages

  • Re: Redirect COUT to file
    ... The old headers are non-standard, ... compile and link this file. ... execute the exe-file the program crashes and I get this error message: ... //BUT NOT WITH CYGWIN G++ ...
    (comp.lang.cpp)
  • Re: Automatically generate variables
    ... use any non-standard stuff in its own headers. ... I did *not* say the program was strictly conforming. ... See, it does compile. ... We are not discussing quality of microsoft implementation, ...
    (comp.lang.c)
  • Re: hid.dll & VC++ 6
    ... VC6 is too old. ... Many of the headers in the current WDK will not compile ... missing ')' before identifier 'HIDP_REPORT_TYPE' ...
    (microsoft.public.win32.programmer.kernel)
  • Re: System headers, compiler conformance...
    ... When I compile it by invoking the compiler in conforming mode, ... Try using gcc -E to inspect the output of the pre-processor. ... See if the headers are there. ... don't use the c99 features in question. ...
    (comp.unix.programmer)
  • Re: Multiple compiler errors - this could hurt your eyes...
    ... No code shown includes any standard C++ headers, ... Where in the code below does the error trail originate, ... Which of the headers above includes standard library headers? ... only when compiling with VC++? ...
    (microsoft.public.vc.language)