Question: GATB - Read fasta files
0
gravatar for robi
7 months ago by
robi10
robi10 wrote:

Hi everyone,

For a project using the GATB library, I have to read Fasta files. I made a code very similar to one of the snippets examples, but I have a linking error during compilation for the "bank" functions. The strange thing is that only "bank" functions produces an linking error (I also use Bloom filters, and it works). Please, could you have a look on it ? Where is the error ?

My directories : ~/MyProject/gatb ~/MyProject/test.cpp Compiling command : g++ test.cpp -Igatb-core/include -Lgatb-core/lib -lgatbcore -lhdf5 -ldl -lz -lpthread -std=c++0x -O3 -o test

Here is my code : https://pastebin.com/3a5zGWwB

And here is the error :

/tmp/cc4mGPEd.o : In the function « main » : test.cpp:(.text.startup+0x87) : undefined reference to « gatb::core::bank::impl::Bank::_open_(std::__cxx11::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&) » collect2: error: ld returned 1 exit status

gatb • 261 views
ADD COMMENTlink modified 7 months ago by guillaume.rizk20 • written 7 months ago by robi10
2
gravatar for guillaume.rizk
7 months ago by
guillaume.rizk20 wrote:

Hi,

I am not sure why you have an error only for bank functions. Anyway, I was able to compile your example from a fresh gatb install with these commands :

cd /Users/grizk/newproj
git clone https://github.com/GATB/gatb-core.git
cd gatb-core/gatb-core
mkdir build ; cd build ; cmake .. ; make -j8

cd /Users/grizk/newproj
GATB=/Users/grizk/newproj/gatb-core/gatb-core

g++ test.cpp -O3  -I${GATB}/src  -I${GATB}/build/include -I${GATB}/thirdparty   -L${GATB}/build/lib -lgatbcore  -lpthread -lz -lhdf5 -std=c++0x -ldl -o test

You can also see a sample makefile in gatb-core/gatb-core/examples.

Guillaume

ADD COMMENTlink written 7 months ago by guillaume.rizk20
1

Thanks a lot ! Seems its working now. Even if I still don't know why it wasn't working before. Thanks again ! Robin

ADD REPLYlink written 7 months ago by robi10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 689 users visited in the last hour