Hi Nash,

Sorry for the late reply, didnt check the forum in a while. Well I couldnt 
find a proper solution to the intptr_t missing definition problem, so 
instead I hard coded it to match our platform's integer representation. 
In src/google/protobuf/stubs/common.h there is a section where int 
representations are typedefed. I added mine there:-

typedef int32 intptr_t;

You can try if this also works for you. just remember if your platform is 
64 bit, then use typedef int64 intptr_t instead.

Regards,
Safi



On Friday, June 28, 2013 6:38:14 PM UTC+3, Nash Kamal wrote:
>
> Just wondering if you were able to resolve your build issue as we are 
> having the same problem while trying to build on the IBM Bluegene Q. If you 
> were able to successfully build by making some changes to the header files 
> please post it here and let us know.
>
> Regards,
> Nash.
>
> On Wednesday, 19 June 2013 04:20:23 UTC-4, Safi Ali wrote:
>>
>> Hi there,
>>
>> Lets start with some background. I'm building on an x86_64 linux server, 
>> and the target platform is powerpc. So far I have generated the cpp files 
>> from my proto files (on the linux machine using protoc) and now im trying 
>> to compile the cpp code for powerpc platform.
>>  
>> Im using the "powerpc-eabi-g++" compiler, and the problem is that as soon 
>> as i start compiling I get this error:-
>>
>> In file included from 
>> /home/esyishh/protobuf-2.5.0/src/google/protobuf/stubs/atomicops.h:59,
>>                  from 
>> /home/esyishh/protobuf-2.5.0/src/google/protobuf/stubs/once.h:81,
>>                  from list_ue.pb.cc:10:
>> /home/esyishh/protobuf-2.5.0/src/google/protobuf/stubs/platform_macros.h:61:2:
>>  
>> error: #error Host architecture was not detected as supported by protobuf
>>
>> When I check the contents of platform_macros.h file, it has the following 
>> platforms supported:-
>>
>> #if defined(_M_X64) || defined(__x86_64__)
>> #define GOOGLE_PROTOBUF_ARCH_X64 1
>> #define GOOGLE_PROTOBUF_ARCH_64_BIT 1
>> #elif defined(_M_IX86) || defined(__i386__)
>> #define GOOGLE_PROTOBUF_ARCH_IA32 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #elif defined(__QNX__)
>> #define GOOGLE_PROTOBUF_ARCH_ARM_QNX 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #elif defined(__ARMEL__)
>> #define GOOGLE_PROTOBUF_ARCH_ARM 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #elif defined(__MIPSEL__)
>> #define GOOGLE_PROTOBUF_ARCH_MIPS 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #elif defined(__pnacl__)
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #elif defined(__ppc__)
>> #define GOOGLE_PROTOBUF_ARCH_PPC 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>> #else
>> #error Host architecture was not detected as supported by protobuf
>> #endif
>>
>> So I get the idea that ppc *is *supported. Here is what my compiler 
>> says:-
>> -> echo | powerpc-eabi-g++ -E -dM - | grep -i ppc
>> #define _ARCH_PPC 1
>> #define __PPC__ 1
>> #define __PPC 1
>> #define PPC 1
>>
>> I thought that it was simply a problem with lowercase Vs uppercase so I 
>> tried to modify the platform_macros.h file and now it contains something 
>> like this:-
>> #elif defined(__PPC__)  //changed ppc from lower case to uppercase to 
>> match the compiler
>> #define GOOGLE_PROTOBUF_ARCH_PPC 1
>> #define GOOGLE_PROTOBUF_ARCH_32_BIT 1
>>
>> and then the compilation goes further but then I end up into some missing 
>> header files issues. Before I try to dig deeper, I wanted to get some 
>> advice from you guys.
>>
>> Do you think this problem is related to the fact that I didnt compile 
>> protocol buffer libraries for powerpc & instead I just compiled them for 
>> the build host environment (x86_64). 
>> Would compiling protocol buffers for powerpc architecture help? (I tried 
>> doing that but ran once again into 'undefined reference' issues, so 
>> probably i will need to tweak the makefile a bit).
>>
>> Regards,
>> Safi
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to