1

I just downloaded protocol buffer (protobuf) 2.5.0 from here. Then I tried to install it on Solaris 8 (SunOS ms-sparc8 5.8). When I try to run make, I got this error.

In file included from google/protobuf/compiler/command_line_interface.h:41,
             from google/protobuf/compiler/main.cc:33:
google/protobuf/stubs/common.h:48:20: stdint.h: No such file or directory

My Solaris dont have stdint.h. So I tried to put a portable stdint.h taken from here and put it inside /usr/include/. After putting in the stdint.h, I tried to run make again and failed. Then I tried to have a look inside the file thats causing the error (command_line_interface.h & main.cc). I make an assumption that command_line_interface.h and main.cc uses common.h header file and the problem are caused by common.h. When I look inside the common.h code, I found this initialization:

#if defined(__osf__)
// Tru64 lacks stdint.h, but has inttypes.h which defines a superset of
// what stdint.h would define.
#include <inttypes.h>
#elif !defined(_MSC_VER)
#include <stdint.h>
#endif

I tried to remove #include <stdint.h> in !define(_MSC_VER) and replace it with <inttypes.h> hoping that it will be forced to use only inttypes.h. Then again, it fails. So my next guess is because the __ost__ is not defined. What does that stand for? When I have a look inside the make log, it confuse me even more. If you need to see the make log. I have paste it here. How can I solve this? Does anyone have the same problem when installing protobuf?

1

You have luck, stdint.h isn't a really complicated header and you can simply produce one.

There are a few possibilities:

  1. On solaris 8, you can use <sys/int_types.h> instead of <stdint.h>. You can either change this in the source code, or you can create your own file in /usr/include/stdint.h with the singleline content "#include <sys/int_types.h>".
  2. You can import this from another system. For example, stdint.h seems very simple and portable in cygwin64.
  3. Or you could get this from glibc as well, although there isn't really beautyfil (glibc tends make everything 10x complexer as it needs to be).

In your place I started with (1) and in case of as problem I made a new question.

  • 1
    Or you could stop trying to build new software on a 15 year old version that hits end of its extended support life this year and move forward to Solaris 10, which has stdint.h already. – alanc May 26 '14 at 20:32
  • @Peter Horvath : Ok. I will try your suggestion one by one. But for the second suggestion. I already did. I gave a link on where I got a portable stdint.h file. But I would like to try the first method and see how it goes. – Mohd Fikrie May 27 '14 at 2:03
  • 1
    @alanc : hahaha.I would love to do so. Its just that the customer are still using the dinosour age server. Can't help it. I need to make sure its compatible with the platform that customer will be using. – Mohd Fikrie May 27 '14 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.