Using My Libraries in Linux
Using My Libraries in Linux
(OP)
I started bringing all of my C libraries and projects to my Linux drive. Currently I'm using Windows and the ancient Borland C 5.5 compiler. (I know. It's old, but I know it really well and it's free.)
To configure the Borland compiler to automatically look in my homemade libraries directory, I have a line in the BCC32.cfg file (where "mylibs" are my routines):
-I"C:\BC55\INCLUDE";"C:\BC55\MYLIBS"
I'm getting used to Linux (Mint), and I just started learning gcc. I just learned about the "ar" command to add my object files to a static library, but how do I get gcc to automatically check my homemade libs folder? Is there a config file for gcc? If there is I couldn't find it.
To configure the Borland compiler to automatically look in my homemade libraries directory, I have a line in the BCC32.cfg file (where "mylibs" are my routines):
-I"C:\BC55\INCLUDE";"C:\BC55\MYLIBS"
I'm getting used to Linux (Mint), and I just started learning gcc. I just learned about the "ar" command to add my object files to a static library, but how do I get gcc to automatically check my homemade libs folder? Is there a config file for gcc? If there is I couldn't find it.
RE: Using My Libraries in Linux
In your .profile/.bashrc or similar
export LIBRARY_PATH=/path/to/my/lib
export CPATH=/path/to/my/headers
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
RE: Using My Libraries in Linux
export LIBRARY_PATH=~/Cthings/mylibs
export CPATH=~/Cthings/mylibs
but I'm still getting "No such file or directory" errors. What am I missing?
RE: Using My Libraries in Linux
Or failing that, absolute paths.
Not everything understands ~ shell magic.
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
RE: Using My Libraries in Linux
RE: Using My Libraries in Linux
So all you need to do is logout and login again.
Also, you can re-read it by just typing in
. $HOME/.profile
--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.