Note that there are some explanatory texts on larger screens.

plurals
  1. POLibrary not linking/including properly
    primarykey
    data
    text
    <p>Alright, I realize that this might seem like a duplicate, but I've tried most variations and attempts via' searched posts, and I'm still coming up with nothing. Here's the issue: I am working with an open-source C library called libxls that is used for reading .xls files (aptly named project.. :) ). The code I'm using is straight off their website, essentially just a beginning toy example to make sure I can access the libraries:<a href="http://libxls.sourceforge.net/" rel="nofollow">Link to their website with the source</a> </p> <pre><code>#include &lt;stdio.h&gt; #include "libxls/xls.h" int main(){ xlsWorkBook* pWB; pWB = xls_open("Book1.xls", "iso-8859-15//TRANSLIT"); return 0; } </code></pre> <p>That's it. Now, the syntax of that is fine. I know for a fact through the nm command that xls_open is indeed available as a function in the .a library, so that's not a problem. in my directory I have the following files (pardon the redundant naming, I was just trying to force it to work real quick):</p> <pre><code>Book1.xls libxlsreader.a libxlsReader.c libxlsreader.so </code></pre> <p>Although I don't THINK I need the .so file here since I've tried dynamically linking to where that lives, figured it wasn't a bad plan to try. Alright, so, on the include line, I keep getting the common:</p> <pre><code>libxlsreader.c:3:37: fatal erro: libxls/xls.h: No such file or directory </code></pre> <p>Ok fine, so I probably linked in the library wrong, take a look at my compile line arguments: </p> <pre><code>gcc -o libxlsWrapper libxlsReader.c -L /usr/local/lib/ -lxlsreader -lpthread </code></pre> <p>huh, well.. that certainly LOOKS right, /usr/local/lib/ is where the library created itself with all of it's .so files, and the .a one in my PWD. Now, I'm a java developer by trade, so I might be missing something blaringly obvious, but for the life of me I can't determine what it is. it certainly seems ok to me. </p> <p>I'm using GCC (ubuntu/Linaro 4.7.3-lubunutul) 4.7.3 on Linux Mint 15 KDE 32-bit. </p> <p>If you'd like to reproduce the library for your own testing or problem solving, it can be obtained from </p> <p>I don't recommend recreating it on windows, I tried for a couple hours yesterday and gave up, so just do the regular ./configure -> make -> make install and that should produce the appropriate libraries for you. </p> <p>Thanks!</p> <p>-Will</p> <p>edit #1: here are some of the other linking attempts I've tried, all with the identical result. </p> <pre><code>gcc -o libxlsWrapper libxlsReader.c -L. -lxlsreader -I. gcc -o libxlsWrapper libxlsReader.c -L. -lxlsreader -lpthread gcc -o libxlsWrapper libxlsReader.c -L. -lxlsreader.so </code></pre> <p>I also tried a bunch with g++ instead of gcc (throwing darts, I know), same result. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload