Shared library, makefile. Library path
<p>Im trying to link my program to the shared library. Im using a makefile to compile. It looks like this: `</p>

<pre><code>make: sms_out.cpp SMSDispatch.cpp SMSDispatch.h
      g++ -c -fPIC SMSDispatch.cpp -o SMSDispatch.o
      g++ -shared SMSDispatch.o -o libSMSDispatch.so
`     g++ sms_out.cpp -L. -lSMSDispatch -o sms_out
</code></pre>

<p>It works fine if I run the program in the command window with:</p>

<pre><code>LD_LIBRARY_PATH="." ./sms_out
</code></pre>

<p>But I want to run it with just <code>./sms_out</code>, can someone help me?
Tried to add <code>export LD_LIBRARY_PATH=.</code> to the makefile, but that didnt work, just got the error " error while loading shared libraries: libSMSDispatch.so: cannot open shared object file: No such file or directory" when I try to run the program.</p>
