Problem with ibm_db, library not found for -lodbc

First, I am a beginner with Rust. I tried to implement a cinnection to an ibm db2-database. I did something like this:

  1. cargo init stats
  2. cd stats
  3. cargo add ibm_db

Download https://crates.io/api/v1/crates/ibm_db/1.0.5/download for the examples. I use connection.rs als main.rs in my project.
When I run:
cargo run --package stats
I got these error-messages:

cargo run --package stats ──(Fr,Jun16)─┘
Compiling stats v0.1.0 (/Users/michael/PyCharmProjects/stats)
error: linking with cc failed: exit status: 1
...
= note: ld: library not found for -lodbc
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: could not compile stats (bin "stats") due to previous error

Can someone help me?

Looks like you need libodbc and it's development package (on debian/ubuntu i would guess it is called libodbc-dev) installed on your system.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.