Menu

#169 possible conflict with streambuf

Feature_Requests
open
5
2003-10-04
2003-10-02
Anonymous
No

#include <streambuf.h>
#include<cc++/thread.h>
int main() {}

This piece of code won't compile.
home/include/cc++/thread.h:318: syntax error before `;'

Maybe there is a conflict with this:
extern "C" {
#include <libio.h>
}
[from streambuf.h]

Swapping the #include statements, all compiles.

Bye

Discussion

  • David Sugar

    David Sugar - 2003-10-04

    Logged In: YES
    user_id=217

    This has been changed even more recently, as we moved some
    fstream/iostream/sstream tests into the generated config.h file,
    so these are now included early. The dependency order of
    headers has also been greatly changed today. This will have to
    be reviewd. But generally, it is probably NOT safe to use
    standard headers BEFORE Common C++ ones, because
    Common C++ (through config.h) defines a bunch of macros that
    establish compile time configurations (like _GNU_SOURCE, or
    BSD_VISIBLE, for example) which will effect other headers after,
    and cause conflict if other headers are pulled first. I suspect the
    simplest solution is to make sure you always start with at least
    #include <cc++/config.h>.

     
  • David Sugar

    David Sugar - 2003-10-04
    • milestone: --> Feature_Requests
    • assigned_to: nobody --> dyfet
    • status: open --> open-postponed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.