Error in compiling C++ in Linux server

Hi, I'm working on a project dealing with Binary-Decision-Diagram(BDD) using CUDD, which is a package for BDD manipulation.

The header files included in my main.cpp are:
#include <bits/stdc++.h> 
#include "cuddObj.hh"
#include "cudd.h"
#include "util.h"
#include "cuddInt.h" 

They are all defined in the CUDD package file, which is in the same hierarchy with my .cpp file .

However, when I'm compiling the .cpp file in the linux server, I get a bunch of errors like:
lab3.cpp:(.text+0x134) : undefined reference to `DD::NodeReadIndex() const'
lab3.cpp:(.text+0x178) : undefined reference to `DD::getNode() const'
lab3.cpp:(.text+0x1ca) : undefined reference to `Cudd::bddOne() const'

But all of the unreferenced functions or objects are in the CUDD package file.
How should I solve this problem?
It's in a hurry! Thx in advance.

Btw, CUDD package is also in Github, here's the link :
Last edited on
Rather than pointing directly at the .a file, perhaps this.
g++ -I $CUDD/cudd/ -I $CUDD/util/ -I $CUDD <file>.cpp -L $CUDD/cudd/.libs -lcudd -lm -O3 -o Lab3

-L is the library path, same as the -I is the include path.

Are you sure that's the only library you need?

@salem c
Sorry for posting a similar question again.

is the path I get after using command : pwd

Is that what I should replace the -L with?
Cause I've already used this path to replace $CUDD.
Last edited on
> Cause I've already used this path to replace $CUDD.

echo $CUDD

Does that print the root directory of all the cudd goodness?
It seems like it should, otherwise you wouldn't even be compiling.

find $CUDD -name "libcudd.a"

Is the library where you said it was (cudd/.libs/libcudd.a)

Are there more libraries to link with, or called different names?
find $CUDD -name "*.a"

Topic archived. No new replies allowed.