DPortAudio

Johannes Pfau spam at example.com
Wed Jul 20 00:45:17 PDT 2011


Andrej Mitrovic wrote:
>Someone mentioned that Linux doesn't need import libs. But I'm having
>linker errors when trying to compile a test file on Linux. I've built
>PortAudio as a shared lib, and installed via make install, and also
>exported an environment variable:
>
>LD_LIBRARY_PATH=/usr/local/lib
>export LD_LIBRARY_PATH
>
>I've also tried manually copying the two (I don't know why there's
>two) shared libraries to the local folder, the libportaudio.so and
>libportaudio.so.2 files.
>
>Command was:
>andrej at andrej-VirtualBox:~/Desktop/dev/DPortAudio/tests$ dmd pa_devs.d
>../portaudio/portaudio.a -I..
>
>portaudio.a is the static lib of DPortAudio which has the converted
>header file that lists all extern(C) function prototypes.
>
>Errors:
>http://codepad.org/AIhYkqiZ
>
>Any ideas?

You have to compile like this:
dmd pa_devs.d ../portaudio/portaudio.a -I.. -L-L/usr/local/lib
-L-lportaudio 

The -L-L/usr/local/lib is maybe not necessary, depends on
if /usr/local/lib is in your standard link path.
If you then run the program and it complains about shared library not
found or something like that, you have to run it with LD_LIBRARY_PATH
set:
LD_LIBRARY_PATH=/usr/local/lib ./pa_devs

-- 
Johannes Pfau



More information about the Digitalmars-d-announce mailing list