Archived

This forum has been archived. Please start a new discussion on GitHub.

Problems with compailing autogenerated files Printer on Solaris

Hello,

I'm just starting with Ice and I have problems with compailing the sample Printer file from demo folder. When I executed the command
c++ -I. -I/usr/Ice-3.2.0/include -c Printer.cpp Server.cpp

I keep getting error:

/opt/Ice-3.2.0/include/IceUtil/Exception.h:19: `exception' is not a class or nam
espace
/opt/Ice-3.2.0/include/IceUtil/Exception.h:19: confused by earlier errors, baili
ng out.

Line number 19 in Exception.h is
"class ICE_UTIL_API IllegalArgumentException : public Exception".

Also, when I tried with make command, I got error:

"make: Fatal error in reader: Makefile, line 34: Unexpected end of line seen".

Line 34 in Makefile is "CPPFLAGS := -I. $(CPPFLAGS)"

Can someone help me with this?

Thanks in advance,

Maja

Comments

  • marc
    marc Florida
    Welcome to the ZeroC forums.

    Which compiler and operating system (and which versions) are you using?
  • I'm using Solaris 10 and gcc-3.4.6.
  • matthew
    matthew NL, Canada
    As can be seen on http://www.zeroc.com/platforms.html this combination is not officially supported and therefore may or may work. Unfortunately for you it appears that it does not work.

    Since you are using /opt I guess you are using some binary distribution you downloaded from us? If so, this cannot and will not work since its for use with Sun C++ 5.8 (part of Sun Studio 11). So, first you must build Ice with gcc, and that appears to have some problem. What you could try is editing include/IceUtil/Exception.h and adding #include <exception> to the top of the file. That may get you further along in the compilation process.

    Your problem with make is likely because you are not using GNU make. This is required to build Ice, as stated in INSTALL.SOLARIS:
    GNU Make 3.80
    -------------
    
    GNU Make 3.80 is required to build Ice on SPARC/Solaris. GNU make is
    distributed on the "Solaris 10 OS Companion Software DVD":
    
    http://www.sun.com/software/solaris/freeware/
    

    That all being said I suspect you will have a far less frustrating experience if you use what we actually support on this platform -- Sun C++ 5.8. This compiler is free -- so unless you have a compelling reason to use gcc I would use this compiler instead.
  • I installed Sun Studio 11 and I'm using Sun C++, but I still have problems.

    I got error :
    "Fatal error in reader: ../../../config/Make.rules, line 119: Unexpected end of line seen".

    Can you help me with that?
  • benoit
    benoit Rennes, France
    Hi,

    It looks like you're still not using GNU make as Matthew mentioned above. What does "make -v" say on your Solaris machine?

    Cheers,
    Benoit.
  • The sam error:

    "make -v: Fatal error in reader: Makefile, line 34: Unexpected end of line seen"
  • benoit
    benoit Rennes, France
    Yes, this indicates that you're not using the GNU make. If you were using GNU make you would see:
    GNU Make 3.80
    Copyright (C) 2002  Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
    PARTICULAR PURPOSE.
    

    Did you try using the "gmake" command instead of "make"? Depending on the platforms, GNU make might be installed as "gmake" instead of "make".

    If this doesn't work, this means that GNU make is not found in your PATH. You should check if it's installed on your machine and add it to your PATH. If not installed, you should install it, you'll find it on the "Solaris 10 OS Companion Software DVD" as Matthew mentioned above.

    Cheers,
    Benoit.
  • I tried gmake. I got error:

    "gmake: execvp: /opt/Ice-3.2.0/bin/slice2cpp: Invalid argument"

    Everything is added to PATH.
  • benoit
    benoit Rennes, France
    Sorry, it's difficult to help if you don't provide more information.

    From which directory are you running gmake?

    Are you trying to compile the Ice source distribution? Or did you install the Ice binary distribution in /opt/Ice-3.2.0 and now try to compile the demos?

    Cheers,
    Benoit.
  • marc
    marc Florida
    Also, try "gmake --recon", and post the output here.
  • bernard
    bernard Jupiter, FL
    Hi Maja,
    Andjeo wrote: »
    I tried gmake. I got error:

    "gmake: execvp: /opt/Ice-3.2.0/bin/slice2cpp: Invalid argument"

    Everything is added to PATH.

    Please verify that you have execute permission on slice2cpp and icecpp in that directory.

    Best regards,
    Bernard
  • gmake --recon returns:

    "rm -f Printer.cpp Printer.h
    /opt/Ice-3.2.0/bin/slice2cpp Printer.ice
    rm -f Printer.cpp Printer.h
    /opt/Ice-3.2.0/bin/slice2cpp Printer.ice
    CC -c -I. -I/opt/Ice-3.2.0/include -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g Printer.cpp
    CC -c -I. -I/opt/Ice-3.2.0/include -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g Client.cpp
    rm -f client
    CC -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g -R /opt/Ice-3.2/lib:/usr/sfw/lib -z text -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g -L/opt/Ice-3.2.0/lib -o client Printer.o Client.o -lIce -lIceUtil -lpthread
    CC -c -I. -I/opt/Ice-3.2.0/include -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g Server.cpp
    rm -f server
    CC -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g -R /opt/Ice-3.2/lib:/usr/sfw/lib -z text -mt +p -features=tmplife -xldscope=hidden +w -erroff=hidef,wvarhidenmem,wvarhidemem -KPIC -g -L/opt/Ice-3.2.0/lib -o server Printer.o Server.o -lIce -lIceUtil -lpthread "

    Slice2cpp, icecpp have execute premission. I install Ice binary distribution in /opt/Ice-3.2.0 and sample programs for binary archivesand I try to compile the demos.
  • benoit
    benoit Rennes, France
    Hi Maja,

    From the printer demo directory, could try running the following and see if it works?

    /opt/Ice-3.2.0/bin/slice2cpp Printer.ice

    On which architecture do you run Solaris 10, SPARC or x86? The Ice-3.2.0 Solaris 10 binary installer was compiled for the SPARC architecture. So if you use a x86 platform it won't work and most likely result in the gmake error you're getting.

    To use Ice with Solaris 10 on an Intel/AMD platform, you'll need to compile Ice from the source distribution. You can download the Ice source distribution from our download page. Follow the instructions from the INSTALL.SOLARIS file at the top level of the source distribution to compile Ice.

    Cheers,
    Benoit.