Menu

config.h problem

Help
Anonymous
2000-06-02
2001-04-16
  • Anonymous

    Anonymous - 2000-06-02

    Hello,

    I am on a Debian Linux system.

    I've been trying to compile and execute a very simple program that consists of:
    #include <cc++/config.h>  //the problem line
    #include <cc++/macros.h>
    #include <cc++/thread.h>
    #include <cc++/socket.h>

    int main () {
        InetAddress addr;
    }

    I've tracked down the problem to the first line #include <cc++/config.h>.  If i remove the line, everything compiles correctly.  If I include it, I get a slew of errors such as:

    /usr/local/include/cc++/thread.h:87: syntax error before ';'
    ''                                                   :153:  ''

    and so on. 
    Can someone help me out?

     
    • David Sugar

      David Sugar - 2000-06-04

      The cc++/config.h file is normally included automatically along with cc++/macros.h
      by cc++/thread.h.  I do not know why directly including it yourself would be a problem offhand in your application, but I generally do not do so since it is normally included automatically.  cc++/config.h is the "config.h" that your package was originally compiled with as generated from autoconf's "configure" script.

       
      • Anonymous

        Anonymous - 2000-06-05

        In the demo directory, tcp.cpp includes both config.h and macros.h so I thought they were both needed all the time.

        I'm trying to make an executable of tcp.cpp from the demo directory.  If I comment out the config.h, I can compile it, but when i try :
        g++ -o tcp tcp.cpp -I/usr/local/include/cc++ -L/usr/local/lib
        I get:
        collect2: ld terminated with signal 11 [Segmentation Fault], core dumped
        /tmp/ccHLHBjW.o: In function 'myTCPSocket::myTCPSOCKET(cc_InetAddress &)':
        /tmp/ccHLHBjW.o(.text+0x17): undefined reference to 'cc_TCPSocket::cc_TCPSocket(cc_InetAddress &, short, int)'

        and then further undefined references to :
        operator<<(ostream &, cc_InetAddress &)
        tcpstream::tcpstream(int)

        and so on.

        Am I missing something here?

        TIA

         
        • David Sugar

          David Sugar - 2000-06-06

          The demo apps do this to include the "local" copy of config.h and macros.h
          that appear with the current Common C++ distribution.  This way if you already
          have and older Common C++ already installed, the demos always build using the new distribution copy prior to install.

           
    • Anonymous

      Anonymous - 2000-06-07

      ok, here is all I'm trying to do:

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

      int main() {}

      //End

      I use: g++ <filename> -o <filename> -I/usr/local/include -L/usr/local/lib/cc++
      and my exact errors are:
      /tmp/cc...:undefined reference to `cc_TCPStream type_info node'
      /tmp/cc...: In function 'tcpstream type_info function':
      /tmp/cc...: undefined reference to `cc_TCPStream type_info function`
      collect2: ld returned 1 exit status

      I think once I get this small (really small) bit of code to work, the rest will follow.

      TIA

       
      • David Sugar

        David Sugar - 2000-06-12

        This is an issue with config.def actually.  When Common C++ is installed, it saves
        the compile options used in cc++/config.def.  In some cases and on some
        systems all apps must be compilied under the same set of flags.  For example,
        gcc on x86 requires -rtti support and not to disable stack frames otherwise
        exception handling code crashes, and the user apps must also be compiled
        with these options otherwise the libraries will not link and bind.

        When one builds an application with autoconf and uses the ost_commoncxx.m4 macro set, these flags are automatically pulled into the CXXFLAGS compiler options.  If you are building by hand, you should look at cc++/config.def and make sure you specify the same compiler options.

         
    • Anonymous

      Anonymous - 2001-04-16

      I'm having the same problem usr/local/include/cc++/thread.h:87: syntax error before ';').
      Did you solve it already ??

      Thank You

       

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.