Menu

.../cc++/thread.h:339 syntax error before ';'

Help
2001-12-31
2002-03-30
  • Sebastian Wain

    Sebastian Wain - 2001-12-31

    I am using Common C++ 1.9.3 with GCC 2.96 compiling a code including:

    cc++/config.h,cc++/strchar.h,cc++/exception.h,
    cc++/thread.h,cc++/socket.h,cc++/iostream.h
    cc++/cstdlib,string,map

    Any idea what's happening? I tried to include
    pthread without any results.

    Thank You
    Sebastian Wain

     
    • John P. Hunter

      John P. Hunter - 2002-01-02

      maybe you should add  -DHAVE_CONFIG_H when you complie your program .

       
      • Sebastian Wain

        Sebastian Wain - 2002-01-02

        The same error happened.

        Thanks
        Sebastian Wain

         
    • Frediano Ziglio

      Frediano Ziglio - 2002-01-06

      ??? I can't understand.
      Before committing any change I compile all demo and source in my RH7.1 and MSVC. Also 1.9.3 compile succefully on  RH7.2.
      Which code are you trying to compile?
      Perhaps your code without installing CommonC++??

       
    • Sebastian Wain

      Sebastian Wain - 2002-01-08

      I tried to compile my own code. I tried before with an old version of common c++.

      May be the gcc 2.96?

      Thank You
      Sebastian Wain

       
      • Frediano Ziglio

        Frediano Ziglio - 2002-01-10

        Well... I didn't change the compiler, I use 2.96 too... perhaps is a strange bug of 1.9.3... have access to cvs ??

         
    • John P. Hunter

      John P. Hunter - 2002-01-15

      Let me tell you what I have found .
      c++ -DHAVE_CONFIG_H -Wall -D_THREAD_SAFE -D__DEBUG__ -c -g -o DDNS DDNS.cpp
      In file included from DDNS.cpp:7:
      /usr/include/cc++/thread.h:339: syntax error before `;'
      make: *** [all] Error 1
      #include <stdio.h>
      #include <cc++/config.h>
      #include <cc++/strchar.h>
      #include <cc++/exception.h>
      #include <cc++/thread.h>
      #include <cc++/socket.h>
      #include <cstdlib>

      and
      when i change to
      #include <cc++/config.h>
      #include <cc++/strchar.h>
      #include <cc++/exception.h>
      #include <cc++/thread.h>
      #include <cc++/socket.h>
      #include <cstdlib>
      #include <stdio.h>

      no error .

      what about you ?
      I can not tell why . Who can tell me ?
      under Redhat 6.2 and Common C++ 1.9.3

       
    • Frediano Ziglio

      Frediano Ziglio - 2002-01-15

      Perhaps is a CommonC++ problem with config.h
      But you shouldn't use new header (cstdlib) and old (stdio.h) together !!!

      freddy77

       
      • John P. Hunter

        John P. Hunter - 2002-01-16

        without stdio.h
        i got
        c++ -DHAVE_CONFIG_H -Wall -D_THREAD_SAFE -D_REENTRANT -D__DEBUG__ -c -g -o DDNS DDNS.cpp
        DDNS.cpp: In method `void DNSSERVER::Run()':
        DDNS.cpp:67: `FILE' undeclared (first use this function)
        sorry , i'm not good at c++ , so i have to use some c sytle codes with common c++ .

         
    • Frediano Ziglio

      Frediano Ziglio - 2002-01-15

      Perhaps is a CommonC++ problem with config.h
      But you shouldn't use new header (cstdlib) and old (stdio.h) together !!!

      freddy77

       
    • shea martin

      shea martin - 2002-02-01

      I get the same error.  I tried rearranging the header #inludes like you did, and do not have a problem.  Did anyone ever solve this problem?

       
    • shea martin

      shea martin - 2002-03-30

      same here, this compiles:

      #include <cc++/thread.h>
      #include <iostream>

      but this won't:
      #include <iostream>
      #include <cc++/thread.h>

      Not a big deal, but it would be nice for this to be posted somewhere in documentation, so I would have to bang my head for hours.

      This only is a problem in linux for me.  It is not a problem in msvc++

       

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.