Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using My Libraries in Linux 1

Status
Not open for further replies.

AbidingDude

Programmer
Oct 7, 2012
74
US
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.
 
Thanks. I tried that. I copied and pasted those two lines to the end of my '.profile' file:

[tt]export LIBRARY_PATH=~/Cthings/mylibs
export CPATH=~/Cthings/mylibs[/tt]

but I'm still getting "No such file or directory" errors. What am I missing?
 
Try using say [pre]$HOME[/pre] rather than [pre]~[/pre]

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.
 
Thank you. That worked. But after I made the change to the '.profile' file, I had to reboot for it to take effect. Is there a way to reload that file without having to do that?
 
Your .profile comes into effect when you login.

So all you need to do is logout and login again.

Also, you can re-read it by just typing in
[tt]. $HOME/.profile[/tt]



--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top