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 8288899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:22:38+00:00 2026-06-08T12:22:38+00:00

I am trying to write a small C based client for mongo db for

  • 0

I am trying to write a small C based client for mongo db for my application. Let me start by saying that I haven’t programmed in C in a long time now, so may be the problem I am facing is a very basic one! I just can not get my code to compile 🙂

I am using a 64 bit Apple Macbook Pro (OSX Lion). The gcc is:

Target: i686-apple-darwin11
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

I git cloned the mongo c driver, did a git checkout to 0.6 and then ran make.

make
make install
make test

The tests ran fine and the libraries were installed correctly in /usr/local/lib/
with the .h files going correctly to /usr/local/include.

Then I copy pasted a piece of code into a file called data.c as follows:

#include <stdio.h>
#include "mongo.h"

int main() {
  mongo conn[1];
  int status = mongo_connect(conn, "127.0.0.1", 27017);
  return 0;
}

Nothing fancy, just trying to open a connection. When I try to compile this, I get the following error:

gcc --std=c99 -I/usr/local/include -L/usr/local/lib -o data data.c -lmongoc

Undefined symbols for architecture x86_64:
  "_mongo_connect", referenced from:
      _main in ccjPPPVs.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

What am I doing wrong?

  • 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-08T12:22:40+00:00Added an answer on June 8, 2026 at 12:22 pm

    The Mongo-C-driver dynamic library build is now fixed for Mac OS X (Lion), see

    https://github.com/mongodb/mongo-c-driver/commit/ea89d8fa966ccf601a67e1507e67e829775f6bcb

    https://jira.mongodb.org/browse/CDRIVER-158

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a small Java application that will let me run
I'm trying to write a small application that needs to use the clipboard for
I'm trying to write a small application and have come across a compile time
Im trying to write a small application that makes isometric shapes. Ive been able
I am trying to write a small application using bouncycastle algorithm, from the BouncyCastleProvider.java
I am trying to write a small Mac command line app that can read
I've been trying to write a small application which will work with mysql in
I am trying to write a function in C# that will take two small
I am trying to write a small application to process networking packet. To facilitate
I am trying to build a small application in C# which should start/stop an

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.