Thread: wat_array instalation

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    222

    wat_array instalation

    can anyone install the following library :

    Downloads - wat-array - wat_array : a wavelet tree library for myriad array operations - Google Project Hosting

    when i install it like this:


    tar -zvjf wat_array-0.0.6.tar.bz2
    cd wat_array-0.0.6
    ./waf configure
    ./waf
    sudo ./waf install


    Code:
    #include <iostream>
    
    #include <wat_array/wat_array.hpp>
    
    int main(){
    
    wat_array::WatArray wa;
    
    }
    i get the following message:


    /tmp/ccsF9ICT.o: In function `main':
    wat.cpp.text+0x10): undefined reference to `wat_array::WatArray::WatArray()'
    wat.cpp.text+0x1c): undefined reference to `wat_array::WatArray::~WatArray()'
    collect2: ld returned 1 exit status

    can anyone repeat this and tell me if he/she is receiving the same problem. and maybe knows the solution ??


    thank you

    baxy

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Did you try linking to the library wat_array?
    If the library does not exist you likely need to build it.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    222
    ok so i have accidently changed

    g++ -L/usr/local/lib -I/usr/local/include -lwat_array -o wat wat.cpp

    to

    g++ wat.cpp -o wat -L/usr/local/lib -I/usr/local/include -lwat_array

    and it is working now. Why is this?? why does the order matter ?

    thank you

    baxy

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by baxy View Post
    why does the order matter ?

    thank you

    baxy
    Order matter for most linkers.
    If object file A needs Object file B then most linkers require B to be after A.
    (Some linkers are in the opposite order; I have never used one of those linkers.)
    (Some linkers the order does not matter)

    Libraries are normally just a collection of object files; this is not always true; but, it is often true.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tc 3.0++ minimum instalation package
    By deian in forum Tech Board
    Replies: 2
    Last Post: 03-25-2005, 03:27 PM