Re: static library problems

Tech-Archive recommends: Fix windows errors by optimizing your registry



Because in the first case u have definition of variable in the header
file itself ie compiler will allocte mem. for this.

If u include function def. in header file, then u need not link with
lib.

Not a good practice.

Could easily result into doubly linked errors...

ALways define definitions in .cpp files.

.



Relevant Pages

  • Re: Header Files and Interfaces Yet Again
    ... compiler is not allowed to read them. ... illustrate the difference of header file and fake header. ... fake headers can not serve as sufficient information to the ... > something but it appears to me the Standard Library is not designed ...
    (comp.lang.cpp)
  • Re: Cpp Considered Harmful
    ... >> I will observe that many Java IDEs do this rather successfully. ... > Look, if a tool author is willing to fully parse the underlying language, ... > compiler version. ... mentions a header file is in the C compatability appendix. ...
    (comp.lang.cpp)
  • Re: Header Files and Interfaces Yet Again
    ... >> The point that I hope to get across is that header files need to provide ... a compiler has to know about them at compile time. ... But he actually uses what you call a fake header. ... differences between Java and C++: In Java all obects appear to be handles. ...
    (comp.lang.cpp)
  • Re: managing header files
    ... The chances that every source file needs every other source file's header is approximately nil. ... When a system gets to hundreds of source files, this can reduce the compilation time significantly because the compiler reads fewer files. ... while in the .h files the external declarations showed no arguments. ...
    (comp.lang.c.moderated)
  • Re: regcmp warning: improper pointer/integer combination: op "="
    ... Type casting is in the standard because there are cases where it can ... an implementation-defined header provides a prototype ... requires the compiler to assume that it ... result to char* doesn't fix the problem, ...
    (comp.lang.c)