[protobuf] Re: Protocol Buffers for IOS

2012-09-11 Thread Sebastian Suchanowski
Hey,

Doing every steps I've problem with #include notation. What I mean is I get

'google/protobuf/stubs/common.h' file not found

at this line

#include google/protobuf/stubs/common.h


and if I change it to 


#include common.h


Then everything is ok, but this is stupid way to do and there is like 
gazylion files :P

How you manage to deal with it? You dropbox link doesn't work - could you 
correct it, maybe it may help.


Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/XM9qZIqixQ0J.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Protocol Buffers for IOS

2012-04-03 Thread Nicola Ferruzzi

 Is there any direct support for Protocol Buffers  in iOS? (armv6,
 armv7)

 I have gone through he following 
 link..http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers

 It uses v2.2 and currently available version is v2.4

I use latest version in my app .. you don't really need objc direct
support if you are familiar with C++, there is only one point where
you have to pass from std::string to NSData and viceversa. And its
pretty simple.

To compile and test the easiest way Ive found is to just import the
whole google directory in my own project :) (the second time you can
make your own framework but for testing this procedure just works)

- download latest version
- autogen configure and make like you were just building for macosx
(you need command line tools) . This way you end up with protoc binary
and the library for macosx (which you don't need)
- open your Xcode iOS project
- add new file to your project and select google directory
- add the directory of google headers to your additional include
directories
- add config.h from the protobuffer src directory to your app
- from the google group remove everything that contains unitest :)
- from the google group remove compiler and java stuff;
- you should be able to compile without any linking error

to give you an idea this is what I directly compile
http://dl.dropbox.com/u/29537941/Screen%20Shot%202012-04-03%20at%2002.22.06.png

Then you can use protoc to generate c++ source files for your
protocol. To use them with objc you have to rename your source to
file  mm then you can do something like

TO SERIALIZE TO NSDATA

let's say your message is called Packet

- (NSData *)getDataForPacket:(Packet *)packet {
std::string ps = packet-SerializeAsString();
return [NSData dataWithBytes:ps.c_str() length:ps.size()];


TO READ FROM NSDATA

- (Packet *)getPacketFromNSData:(NSData *)data {
  char raw[[data length]];
  Packet *p = new Packet;
  [data getBytes:raw length:[data length]];
  p-ParseFromArray(raw, [data length]);
  return p;
}

this should give you a good start :)
-Nicola

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



[protobuf] Re: Protocol Buffers for IOS

2012-04-02 Thread Dhanaraj G
One more option i found is in following link..

http://tinsuke.wordpress.com/2011/02/17/how-to-cross-compiling-libraries-for-ios-armv6armv7i386/


We just need to copy the following file to /protobuf-2.4.1/ folder

http://goo.gl/OuP7f

then give the command in terminal

cd protobuf-2.4.1/
bash build_dependencies.sh

You will get the universal binary in protobuf-2.4.1/outdir folder

Regards,
Dhanaraj




On Apr 1, 4:50 am, Evan Jones ev...@csail.mit.edu wrote:
 On Mar 31, 2012, at 4:31 , Dhanaraj G wrote:

  I have gone through he following link..
 http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers

 There is no official support but I've used the following distribution with 
 success, with the latest protoc (I'm pretty sure):

 https://github.com/booyah/protobuf-objc

 Good luck,

 Evan

 --http://evanjones.ca/

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.