compiling client in xcode

311 views
Skip to first unread message

ForeverNils

unread,
Jan 26, 2012, 1:07:20 AM1/26/12
to mongodb-user
Hello dear mongodb-user )

I have a problem with compiling client for mongodb in xcode.
This is what I've done:
1. "scons mongoclient" and get libmongoclient.a - no problem, no
errors
2. create c++ static library with "#include "dbclient.h"" in xcode and
build it in xcode - no problem, no errors
3. create cocoa app and link it with my static c++ library, rename .m
to .mm - after trying to build cocoa app I get errors

assert_util.h:182:37
too many arguments provided to function-like macro invocation [2]
inline void verify( int msgid , bool testOK ) { if ( ! testOK )
verifyFailed( msgid ); }

dbclient_rs.h
Expected member name or ';' after declaration specifiers
void check( bool checkAllSecondaries );

Can you write what I did wrong?
Thank you.

Richard Kreuter

unread,
Jan 26, 2012, 11:56:40 AM1/26/12
to mongodb-user
Is that all the error/warning output from your compile job? If not,
could you post the rest?

Nazar Pallaev

unread,
Jan 26, 2012, 12:07:48 PM1/26/12
to mongod...@googlegroups.com
Hello
Just in case I put screenshot in attach with errors.

mongodb-mongo-5dcf40b/src/mongo/util/assert_util.h
inline void verify( int msgid , bool testOK ) { if ( ! testOK ) verifyFailed( msgid ); }
Too many arguments provided to function-like macro invocation
'inline' can only appear on functions
Variable has incomplete type 'void'
Expected ';' after top level declarator

mongodb-mongo-5dcf40b/src/mongo/client/dbclient_rs.h
void check( bool checkAllSecondaries );
Expected member name or ';' after declaration specifiers

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

Nazar Pallaev

unread,
Jan 26, 2012, 12:24:09 PM1/26/12
to mongod...@googlegroups.com
warnings
mongodb-mongo-5dcf40b/src/mongo/bson/bsonobjbuilder.h
fill(n);
Implicit conversion loses integer precision: 'long' to 'int'

mongodb-mongo-5dcf40b/src/mongo/util/time_support.h
unsigned secs = tv.tv_sec % 1024;
Implicit conversion loses integer precision: 'long' to 'unsigned int'

mongodb-mongo-5dcf40b/src/mongo/util/mongoutils/str.h
int l = p.size();
int x = s.size();
Implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int'

mongodb-mongo-5dcf40b/src/mongo/util/net/message.h
d->len = fixEndian(dataLen);
Implicit conversion loses integer precision: 'unsigned long' to 'int'

mongodb-mongo-5dcf40b/src/mongo/client/dbclientcursor.h
int objsLeftInBatch() const { _assertIfNull(); return _putBack.size() + batch.nReturned - batch.pos; }
Implicit conversion loses integer precision: 'unsigned long' to 'int'


On Jan 26, 2012, at 8:56 PM, Richard Kreuter wrote:

Matthew Shopsin

unread,
Jan 26, 2012, 2:13:30 PM1/26/12
to mongodb-user
What compiler flags did you have set?

Nazar

unread,
Jan 27, 2012, 12:33:00 AM1/27/12
to mongod...@googlegroups.com
No flags. Build with Apple LLVM compiler 3.0.
In build settings there are:
- enable C++ runtime types = YES
- other C flafs = empty
- other C++ flags = empty


2012/1/26 Matthew Shopsin <matt.s...@10gen.com>
What compiler flags did you have set?

Nazar

unread,
Jan 27, 2012, 12:39:05 AM1/27/12
to mongod...@googlegroups.com
Hello Richard,

I've commented code
void check( bool checkAllSecondaries );
in client/dbclient_rs.h

and code
inline void verify( int msgid , bool testOK ) { if ( ! testOK ) verifyFailed( msgid ); } 
in util/assert_util.h

and have no errors. But is it correct to comment this code?

2012/1/27 Nazar <forev...@gmail.com>

Eliot Horowitz

unread,
Jan 27, 2012, 9:18:15 PM1/27/12
to mongod...@googlegroups.com
You shouldn't have to compile those out if that's what you mean?

Nazar Pallaev

unread,
Jan 28, 2012, 2:44:07 AM1/28/12
to mongod...@googlegroups.com
I mean that when I try to compile project I get errors that I mentioned before.
But I'm afraid that those commented code will be used in future from some other files and it will cause errors.

Eliot Horowitz

unread,
Jan 28, 2012, 11:46:04 PM1/28/12
to mongod...@googlegroups.com
Can you send the compile line that is failing?

Nazar Pallaev

unread,
Jan 29, 2012, 1:11:32 AM1/29/12
to mongod...@googlegroups.com
two lines in two files:

>>>> void check( bool checkAllSecondaries );
>>>> in client/dbclient_rs.h


and


>>>> inline void verify( int msgid , bool testOK ) { if ( ! testOK ) verifyFailed( msgid ); }
>>>> in util/assert_util.h

Eliot Horowitz

unread,
Jan 29, 2012, 11:47:50 PM1/29/12
to mongod...@googlegroups.com
I meant how was that file compiled.

Nazar Pallaev

unread,
Jan 30, 2012, 12:15:43 AM1/30/12
to mongod...@googlegroups.com
I don't think I quite understand you, file was compiled with apple llvm using xcode4.2

Sent from my iPhone

Matthew Shopsin

unread,
Feb 1, 2012, 6:28:52 PM2/1/12
to mongodb-user
What version of mongoDB source was being used?
Is your mongoDB install 64-bit?
What version of Xcode were you using?
What version of Mac OS X are you using?


On Jan 29, 9:15 pm, Nazar Pallaev <forevern...@gmail.com> wrote:
> I don't think I quite understand you, file was compiled with apple llvm using xcode4.2
>
> Sent from my iPhone
>
> On Jan 30, 2012, at 8:47, Eliot Horowitz <el...@10gen.com> wrote:
>
>
>
>
>
>
>
> > I meant how was that file compiled.
>
> > On Sun, Jan 29, 2012 at 1:11 AM, Nazar Pallaev <forevern...@gmail.com> wrote:
> >> two lines in two files:
> >>>>>> void check( bool checkAllSecondaries );
> >>>>>> in client/dbclient_rs.h
>
> >> and
> >>>>>> inline void verify( int msgid , bool testOK ) { if ( ! testOK ) verifyFailed( msgid ); }
> >>>>>> in util/assert_util.h
>
> >> On Jan 29, 2012, at 8:46 AM, Eliot Horowitz wrote:
>
> >>> Can you send the compile line that is failing?
>
> >>> On Sat, Jan 28, 2012 at 2:44 AM, Nazar Pallaev <forevern...@gmail.com> wrote:
> >>>> I mean that when I try to compile project I get errors that I mentioned before.
> >>>> But I'm afraid that those commented code will be used in future from some other files and it will cause errors.
>
> >>>> On Jan 28, 2012, at 6:18 AM, Eliot Horowitz wrote:
>
> >>>>> You shouldn't have to compile those out if that's what you mean?
>
> >>>>> On Fri, Jan 27, 2012 at 12:39 AM, Nazar <forevern...@gmail.com> wrote:
> >>>>>> Hello Richard,
>
> >>>>>> I've commented code
> >>>>>> void check( bool checkAllSecondaries );
> >>>>>> in client/dbclient_rs.h
>
> >>>>>> and code
> >>>>>> inline void verify( int msgid , bool testOK ) { if ( ! testOK )
> >>>>>> verifyFailed( msgid ); }
> >>>>>> in util/assert_util.h
>
> >>>>>> and have no errors. But is it correct to comment this code?
>
> >>>>>> 2012/1/27 Nazar <forevern...@gmail.com>
>
> >>>>>>> No flags. Build with Apple LLVM compiler 3.0.
> >>>>>>> In build settings there are:
> >>>>>>> - enable C++ runtime types = YES
> >>>>>>> - other C flafs = empty
> >>>>>>> - other C++ flags = empty
>
> >>>>>>> 2012/1/26 Matthew Shopsin <matt.shop...@10gen.com>
>
> >>>>>>>> What compiler flags did you have set?
>
> >>>>>>>> --
> >>>>>>>> You received this message because you are subscribed to the Google Groups
> >>>>>>>> "mongodb-user" group.
> >>>>>>>> To post to this group, send email to mongod...@googlegroups.com.
> >>>>>>>> To unsubscribe from this group, send email to
> >>>>>>>> mongodb-user...@googlegroups.com.
> >>>>>>>> For more options, visit this group at
> >>>>>>>>http://groups.google.com/group/mongodb-user?hl=en.
>
> >>>>>> --
> >>>>>> You received this message because you are subscribed to the Google Groups
> >>>>>> "mongodb-user" group.
> >>>>>> To post to this group, send email to mongod...@googlegroups.com.
> >>>>>> To unsubscribe from this group, send email to
> >>>>>> mongodb-user...@googlegroups.com.
> >>>>>> For more options, visit this group at
> >>>>>>http://groups.google.com/group/mongodb-user?hl=en.
>
> >>>>> --
> >>>>> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> >>>>> To post to this group, send email to mongod...@googlegroups.com.
> >>>>> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> >>>>> For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> >>>> To post to this group, send email to mongod...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> >>>> For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> >>> To post to this group, send email to mongod...@googlegroups.com.
> >>> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> >>> For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> >> To post to this group, send email to mongod...@googlegroups.com.
> >> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> >> For more options, visit this group athttp://groups.google.com/group/mongodb-user?hl=en.

Nazar Pallaev

unread,
Feb 2, 2012, 12:56:27 PM2/2/12
to mongod...@googlegroups.com
mongo source 2.0.2
Yes 64 bit
xcode 4.2
os x lion
Reply all
Reply to author
Forward
0 new messages