Menu

Newbie problem with compiling on HP-UX

Help
gaurav
2005-02-23
2013-04-22
  • gaurav

    gaurav - 2005-02-23

    I am trying to compile the basic MoneyTest program on HP-UX using aCC. But I am having some problems. My MoneyTest.C look like,

    1  #include "MoneyTest.H"
         2
         3  CPPUNIT_TEST_SUITE_REGISTRATION(MoneyTest);
         4
         5  void MoneyTest::setUp() {}
         6
         7  void MoneyTest::tearDown() {}
         8
         9  void MoneyTest::testConstructor() {
        10          CPPUNIT_FAIL("Not implemented");
        11  }

    At Line 3, I am getting the following compilation errors -

    Error 423: "MoneyTest.C", line 3 # Expected the name of the class before the :: operator. Perhaps you have not declared the class yet.

    Error 318: "MoneyTest.C", line 3 # A template name was expected instead of '<type inserted by compiler>' . Did you forget to define the template?

    Error 20: "MoneyTest.C", line 3 # '::' expected before 'autoRegisterRegistry__3'.

    My compiler options are -

    aCC -g0 -c -y -AA -ext -mt

    Any help is appreciated.

    Thanx
    gaurav

     
    • Layne

      Layne - 2005-02-23

      I don't see anythign wrong with the above code.  Can you also show us MoneyTest.H?  Also, show the full command line you are using to compile this.  I'm not completely familiar with aCC, but it looks like you listed the compiler options but left out other command line arguments (like the names of the files to compile).  Are you using make or another build tool?  If so, posting the make file or equivalent may also be helpful to help you track down your problem.

       
    • gaurav

      gaurav - 2005-02-23

      Here is the code for MoneyTest.H,

      1  #ifndef MONEYTEST_H
           2  #define MONEYTEST_H
           3  #include <cppunit/extensions/HelperMacros.h>
           4
           5  class MoneyTest : public CppUnit::TestFixture {
           6          CPPUNIT_TEST_SUITE(MoneyTest);
           7          CPPUNIT_TEST(testConstructor);
           8          CPPUNIT_TEST_SUITE_END();
           9
          10  public:
          11          void setUp();
          12          void tearDown();
          13
          14          void testConstructor();
          15  }
          16  #endif

      Below is the detail of compiler output,

           1  # PROJECT MoneyTest
           2  # Building Project: MoneyTest
           3  # ENV vars set: COMPFLAGS_LD_MoneyTestExecutable=-g0 , COMPFLAGS_CXX_MoneyTestExecutable=-g0 -y
           4          aCC -c  -g0 -y -AA  -ext  -mt  -v  +inst_directed -Icppunit/include/  -Icppunittest/ -o MoneyApp.o MoneyAp

      ..cppunittest"
           6  /opt/aCC/bin/aCC -c -g0 -AA -ext -mt -v +inst_directed -Iinclude/ -Icppunittest/ -o MoneyApp.o MoneyApp.C
           7   /opt/aCC/lbin/ctcom.pa20 -inst directed -ext on -test namespaces -koenig_lookup on -ansi_for_scope on -inline_power 1 -longbranch 2 -unique_strings on
      -o MoneyApp.o -cachesize 256 -Icppunit/include/ -Icppunittest/ -I/opt/aCC/include_std -I/opt/aCC/include_std/iostream_comp
      1 -D__hpux -D__unix -D__hppa -D__hp9000s800 -D__parisc -D__STDCPP__ -D_HP_NAMESPACE_STD -D_ILP32 -D__HP_aCC=33700 -D_REENTRANT -D_RWSTD_MULTI_THREAD -D_RW_MULTI
      =199506L -D_PA_RISC2_0 -D_INCLUDE_LONGLONG -debug debugG MoneyApp.C -driver_command="/opt/aCC/bin/aCC -c -g0 -AA -ext -mt -v +inst_directed -I cppunittest/ "
           8  /opt/softbench/lib/sbparse -I cppunit/include/ -I cppunittest/ -D __hppa -D __hpux -D __unix -D __hp9000s800 -D __
      -I /opt/aCC/include -I /opt/aCC/include/iostream -I /usr -I /usr/include -sa on -ca on -lang c++ -ansi on -diag u MoneyApp.C
                                                                                                                                   9  Warning 448: "
      er.h", line 67 # Operator '::' must be preceded by a name of a namespace or class; 'std' is neither.
          10                           std::ostream &stream,
          11                           ^^^^^^^^^^^^^^^^^^^^^
          12          aCC -c  -g0 -y -AA  -ext  -mt  -v  +inst_directed -Icppunit/include/  -Icppunittest/ -o MoneyTest.o MoneyT

      ..cppunittest"
          14  /opt/aCC/bin/aCC -c -g0 -AA -ext -mt -v +inst_directed -Icppunit/include/ -Icppunittest/ -o MoneyTest.o MoneyTest.

      directed -ext on -test namespaces -koenig_lookup on -ansi_for_scope on -inline_power 1 -longbranch 2 -unique_strings on
      -o MoneyTest.o -cachesize 256 -Icppunit/include/ -Icppunittest/ -I/opt/aCC/include_std -I/opt/aCC/include_std/iostream_com
      =1 -D__hpux -D__unix -D__hppa -D__hp9000s800 -D__parisc -D__STDCPP__ -D_HP_NAMESPACE_STD -D_ILP32 -D__HP_aCC=33700 -D_REENTRANT -D_RWSTD_MULTI_THREAD -D_RW_MULT
      E=199506L -D_PA_RISC2_0 -D_INCLUDE_LONGLONG -debug debugG MoneyTest.C -driver_command="/opt/aCC/bin/aCC -c -g0 -AA -ext -mt -v +inst_directed -I cppunittest/ "
          16  Error 423: "MoneyTest.C", line 3 # Expected the name of a class before the :: operator. Perhaps you have not declared the class yet.
          17      CPPUNIT_TEST_SUITE_REGISTRATION(MoneyTest);
          18      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          19  Error 318: "MoneyTest.C", line 3 # A template name was expected instead of '<type inserted by compiler>'. Did you forget to define the template?
          20      CPPUNIT_TEST_SUITE_REGISTRATION(MoneyTest);
          21      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          22  Error 20: "MoneyTest.C", line 3 # '::' expected before 'autoRegisterRegistry__3'.
          23      CPPUNIT_TEST_SUITE_REGISTRATION(MoneyTest);
          24      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          25  Error 445: "MoneyTest.C", line 3 # Cannot recover from earlier errors.
          26      CPPUNIT_TEST_SUITE_REGISTRATION(MoneyTest);
          27      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          28   removing MoneyTest.o
          29  *** Error exit code 2
          30  Stop.
          31  Non-Zero status from child process.
          32  # PROJECT MoneyTest BUILD-TARGET Failed
          33

       

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.