[CDRIVER-3717] Installation instructions do not mention installing driver dev packages Created: 10/Jun/20  Updated: 18/Dec/23  Resolved: 17/May/23

Status: Closed
Project: C Driver
Component/s: docs
Affects Version/s: None
Fix Version/s: 1.24.0

Type: Bug Priority: Minor - P4
Reporter: Oleg Pudeyev (Inactive) Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File dnf_finds_nothing.png     PNG File yum_not_installed.png    
Issue Links:
Related
related to CDRIVER-4797 Reintroduce instructions to install d... Closed
Quarter: FY24Q2

 Description   

http://mongoc.org/libmongoc/current/installing.html appears to have instructions for two use cases:

  • Installing a release of libmongoc when another program wants to use libmongoc
  • Building libmongoc from source

It appears to not address the use case of someone installing libmongoc to develop an application with it, which could perhaps be the most common use case, and in which situation libmongoc-dev/libbson-dev packages must also be installed.

SO inquiry: https://stackoverflow.com/questions/62289167/compiling-c-program-with-libmongoc-1-0/



 Comments   
Comment by Tomas Llorente [ 31/Jul/23 ]

Problem solved.
Thanks!

Comment by Kevin Albertson [ 31/Jul/23 ]

The mongo-c-driver package appears to have development files necessary to compile an application using the C driver. The following steps were used to build a test application using the C driver on Arch Linux using pacman to install the package:

Update package database:

pacman -Sy

Install tools to compile a test program:

pacman -S gcc pkg-config

Install the C driver:

pacman -S mongo-c-driver

Compile a test program:

gcc -o hello_mongoc hello_mongoc.c $(pkg-config --libs --cflags libmongoc-1.0)

Where the contents of hello_mongoc.c are as follows:

#include <mongoc/mongoc.h>
 
int main() {
    printf ("loaded libmongoc: %s\n", mongoc_get_version());
}

Comment by Tomas Llorente [ 31/Jul/23 ]

I find that the fix for this issue consisted in suggesting the use of apt (or dnf, or yum)
to install libmongoc-dev (a.k.a. mongo-c-devel for dnf or yum).

That suggestion was incorporated in the, already mentioned, install instructions:
http://mongoc.org/libmongoc/current/installing.html

The problem is that this solution is not possible in Arch Linux, since:
a) apt cannot be used
b) yum cannot be installed (I just tried by several standard means; screenshot attached to this comment)
c) dnf does not find that package (I just tried; screenshot attached to this comment) )

Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3717 show dev packages in install instructions (#1270)

  • update Debian and Ubuntu instructions

Use `-dev` packages in default instructions. Users reading instructions may be more likely to want to build applications with the C driver.

Link to Debian package pages to reference version.

fix format on debian instructions

  • update Fedora and Red Hat instructions

Use `-devel` packages in default instructions. Users reading instructions may be more likely to want to build applications with the C driver.

  • simplify links
Generated at Wed Feb 07 21:18:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.