Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7842405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:18:52+00:00 2026-06-02T16:18:52+00:00

Is the metasyntactic static library for iOS . . . http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers . . .

  • 0

Is the metasyntactic static library for iOS . . .

http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers

. . . compatible with regular old C++ compiled protofiles? I do not want to use the bundled compiler that generates Obj-C.

Is there any way to compile the library supplied by Google for iOS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:18:53+00:00Added an answer on June 2, 2026 at 4:18 pm

    Ok. It appears that the metasyntactic library (or any other 3rd party library) is unnecessary in this case. You can just add the Google source directly to your project. I found the following answer from Nicola Ferruzzi in a google discussion group . . .

    The original answer is here . . .

    http://groups.google.com/group/protobuf/browse_thread/thread/ca4218d7db144252

    The content of this answer is included below with images to make a permanent record …


    EDIT

    Since trying this again tonight for the first time in a while, I needed a couple more steps in addition to those outlined below (this works with protobuf 2.5.0).

    • You’ll need to link against libz.dylib. You set this in Build Phases > Link Binary With Libraries.
    • To easily remove all of the unit test related stuff, use the following command from the shell in the google directory find . -name "*unittest*" -exec rm -rf {} \;
    • Also delete the folder called testing
    • comment out #include <google/protobuf/testing/googletest.h> in stringprintf.cc
    • Now carefully follow the instructions below and all should work fine.

    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

    enter image description here

    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; 
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this library: PB for ObjC http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers . The problem is I can't
I'm using cocoaasyncsocket to send data Google Protocol Buffers (using http://code.google.com/p/metasyntactic/wiki/ProtocolBuffers ) to a
I'm attempting to send a .proto message from an iPhone application to a Java
In english, the variables foo and bar are very often used for simple examples,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.