# Linux programmers: Help!

**URL:** https://boards.straightdope.com/t/linux-programmers-help/145227
**Category:** Factual Questions
**Created:** [December 27, 2002, 8:32pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227 "2002-12-27T20:32:54Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)
#### Post date: [December 27, 2002, 8:32pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/1 "2002-12-27T20:32:54Z")

</div>

Ok, the semi-relevant background information:  
I have a project I’m working on, primarily to learn to be a somewhat competent programmer. The point of this project is for me to learn how to write a program with a GUI, and the toolkit I’ve chosen to use is GTK+ with the GTK-- (GTKmm) wrapper for C++.

Now I’m going through the documentation and introduction to gtkmm at [http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch03.html](http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch03.html). I put in the basic, basic sample program, and everything compiled fine. But when I try to run it, I get this error:

> [@](#):
>
> ./gtktest: error while loading shared libraries: libgtkmm-2.0.so.1: cannot open shared object file: No such file or directory

Now I know the file is there, because I spent a couple hours last night compiling and installing packages to be sure gtkmm-2.0 is installed properly, and a quick ‘find’ reveals that libgtkmm-2.0.so.1 is located in /usr/local/lib/, exactly where you might expect it to be.

Now I’m pretty strong at configuring unix, networking, installing systems and packages, troubleshooting, and shell and very basic c/c++ programming, etc, so I’m not a complete newbie, and can understand a technical answer. But I’m in the dark with this whole aspect of it.

How do I tell my system that the file is present, where to find it, and that it should be used?

As a side question, how would I link the libraries in statically (just a curiosity, since I do want to use dynamic linking)?

---

<div class="post-metadata">

### Author: ![fauxpas](https://avatars.discourse-cdn.com/v4/letter/f/e480ec/32.png) [@fauxpas](https://boards.straightdope.com/u/fauxpas)
#### Post date: [December 27, 2002, 8:47pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/2 "2002-12-27T20:47:50Z")

</div>

well first of tell your computer by going to regedit and changing the name of one the programs files or for a more better resul create a new file and call it (program name) syntax code for entering and using. WALLAH!

---

<div class="post-metadata">

### Author: ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)
#### Post date: [December 27, 2002, 9:54pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/3 "2002-12-27T21:54:10Z")

</div>

I have no idea what you just said. Sounds like marketing advice from Mousebat, Follicle, Goosecreature, Ampersand, Spong, Wapcaplet, Looseliver, Vendetta, and Prang.

The NOW program!

---

<div class="post-metadata">

### Author: ![sweepkick](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@sweepkick](https://boards.straightdope.com/u/sweepkick)
#### Post date: [December 27, 2002, 10:08pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/4 "2002-12-27T22:08:33Z")

</div>

Hmm… what happens if you set the LD\_LIBRARY\_PATH environment variable to /usr/local/lib?

---

<div class="post-metadata">

### Author: ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)
#### Post date: [December 27, 2002, 10:16pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/5 "2002-12-27T22:16:24Z")

</div>

> [@](#):
>
> \*Originally posted by fauxpas \*  
> \*\*well first of tell your computer by going to regedit and changing the name of one the programs files or for a more better resul create a new file and call it (program name) syntax code for entering and using. WALLAH! \*\*

Linux doesn’t have a registry or anything like a registry. Your comments may be appropriate in a MS-Windows environment, but not in Linux.

BTW, the word is `_viola_’.

---

<div class="post-metadata">

### Author: ![Joe\_Cool](https://avatars.discourse-cdn.com/v4/letter/j/ecb155/32.png) [@Joe\_Cool](https://boards.straightdope.com/u/Joe_Cool)
#### Post date: [December 27, 2002, 10:33pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/6 "2002-12-27T22:33:42Z")

</div>

> [@](#):
>
> \*Originally posted by sweepkick \*  
> \*\*Hmm… what happens if you set the LD\_LIBRARY\_PATH environment variable to /usr/local/lib? \*\*

What happens? Why, the program works. Thanks much. I knew it’d be something simple like that.

By any chance, do you know what the default path is? Is it just /usr/lib or is there more to it?

---

<div class="post-metadata">

### Author: ![friedo](https://avatars.discourse-cdn.com/v4/letter/f/8edcca/32.png) [@friedo](https://boards.straightdope.com/u/friedo)
#### Post date: [December 27, 2002, 10:44pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/7 "2002-12-27T22:44:08Z")

</div>

Try adding /usr/local/lib to /etc/ld.so.conf and re-running ldconfig. That should add the new libraries to your linker permanently.

---

<div class="post-metadata">

### Author: ![Some\_Guy](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Some\_Guy](https://boards.straightdope.com/u/Some_Guy)
#### Post date: [December 27, 2002, 11:20pm UTC](https://boards.straightdope.com/t/linux-programmers-help/145227/8 "2002-12-27T23:20:45Z")

</div>

> [@](#):
>
> \*Originally posted by Derleth \*  
> \*\*Linux doesn’t have a registry or anything like a registry. Your comments may be appropriate in a MS-Windows environment, but not in Linux.
> 
> BTW, the word is `_viola_’. \*\*

It is actually ‘voila’ 😛 .

Oh, and just to actually add to the topic, you should also make sure that all library files, and the directories you store them in, have appropriate permissions - it’s not enough for the permissions on your executable to be correct. Just a note for the future; doesn’t sound like you need it now.
