Re: how to include some dll functions in a project

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi bigbig,

> I finally solve the problem by moving all the #include directives from bidon.h
to bidon.c.

I have a list of shoulds & oughts for header files.

Header files should not emit bytes (neither code, nor data) when compiled.

If at all possible, header files should be idempotent and self-contained.
They should include any header files they depend upon, and vice versa,
should not include header files they do not depend upon.  (There are
exceptions to this rule, but the better this ruled is followed, the better
off your project will be.)

For C++ headers, they may include things such as...
+ comments
+ conditional compilation directives
+ constant definitions
+ data declarations
+ enumerations
+ function declarations (function prototypes)
+ include directives (but only those things that header itself depends upon)
+ inline function definitions
+ macro definitions (but I plead to use constraint)
+ name declarations (forward references)
+ named namespaces (but NOT anonymous namespaces)
+ template declarations
+ template definitions
+ type definitions

A header should never contain things-that-emit-bytes...
x aggregate definitions
x data definitions
x exported template definitions
x ordinary function definitions
x unnamed namespaces

I expect the problem you ran into was having one of those things that
shouldn¹t be in a header file, in one of your header files.

HTH,
<Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux