![]() |
flex problem: gcc, installed libraries, $LD_LIBRARY_PATH
I have downloaded and compiled the current flex, version 2.6.0.
I have installed in on an alternate folder, using a prefix passed to the configure script: /home/me/local. Although the flex documentation I have read did not say it, I have changed my bashrc to add the lib subfolder where flex is installed: /home/me/local/lib/. Before doing this, the same problem happened, and I thought this could fix it. Now I'll paste some terminal lines that speak well enough: Code:
|
When installing libs to non standard places you need to add that path to /etc/ld.so.conf, then run ldconfig ( all as root of course ).
|
if this is all you got from the command
Code:
$ echo $LD_LIBRARY_PATH that echo command SHOULD have returned " /usr/include " along with that What Operating System are you using ? and WHY not use your packagemanager for installing a BASIC part of the OS |
gcc does not use either LD_LIBRARY_PATH or ldconfig during linking. You need to specify:
gcc gcc lex.yy.c -L<path-to-lib> -lfl (LD_LIBRARY_PATH must not contain /usr/include anyway) |
The option to compile and install from source must work (given some dependencies, for some), independently of the package being available or not on the OS. It is not magic (usually... hehe). And I like it. :)
There is a Debian, an Ubuntu (not current), and possibly a Mint will exist too. I prefer the Debian family members, but sometimes I have to use others. |
Quote:
alias gcc='gcc -ggdb -Wall -L/home/me/local/lib' It solved the problem. Thank you very much! |
Quote:
|
All times are GMT -5. The time now is 10:25 AM. |