Hi Earnie and Keith,
Thankyou both for your replies to my message. I will take on board
your advice and reinstall Portaudio using the --prefix option. The
reason I had to use Cygwin and '-mno-cygwin' was because MSYS had an
error when using the shared library that had been created. You are
correct in where the libraries had been installed - they were
installed into Cygwin's /usr/local paths, not the paths of MinGW or
MSYS. May I just check that the '--prefix=/path/to/mingw/' is the
correct option to install to MinGW paths?
Anyway, for the moment, due to time constraints from other activites,
I will use the linker's -L configuration option. When I get more time
in a few weeks, I will then reinstall, as per your messages. I have
one question though, when do I specify the '-L' option for the linker?
I am almost certain that it is during the ./configure LDFlags
variable, but I'm not totally sure. Is this correct?
Once again, thankyou both your help.
Earnie Boyd wrote:
Quoting Hugh McMaster <dasjournal@...>:
> Hi everyone,
> I am attempting to compile a Windows binary using Portaudio
> (http://www.portaudio.com) and MinGW. Actually, through Cygwin.
So my guess would be that you used the default prefix of /usr/local to
build and install this package.
> At the end of the entire compile, the build ends while attempting to
> link to -lportaudio. It exits with this error:
> [...] -lgdi32 -lcomdlg32 -lportaudio -lwinmm
> cannot find -lportaudio [...]
Use the -L switch to indicate the /path/to/libportaudio.a or
> I installed Portaudio through Cygwin (using -mno-cygwin flags). I
With Cygwin the path you specify must be the windows path and not the
> also attempted to compile my binary through MSYS. It returned the
With MSYS the path you specify can be either the windows path or the
/usr/local emulated path.
> same error. Does the error mean that Portaudio has not properly been
> installed for MinGW, but has been for Cygwin, since that is where I
> ran the ./configure, make, make install commands?
It is *BAD* to configure with one system and then use the Makefile and
config.h created for that system elsewhere. You need to execute
configure again and ensure that any configure cache, if one exists, is
removed. You can typically do this with ``make distclean''.
> Thankyou for your help.
Rather than using the default prefix of /usr/local you can also use
--prefix=/mingw for the configure command and then you will not need to
specify the -L /path/to/libfoo.a.
On 31/10/06, Keith MARSHALL wrote:
> Hugh McMaster wrote:
> > [...] -lgdi32 -lcomdlg32 -lportaudio -lwinmm
> > c:\mingw\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe:
> > cannot find -lportaudio [...]
> > I installed Portaudio through Cygwin (using -mno-cygwin flags).
> AIUI, `-mno-cygwin' is just a Cygwin kludge, to make the GCC driver
> use the MinGW backends, rather than Cygwin's own; kind of equivalent
> to cross compiling with `--build=i386-pc-cygwin --host=i386-pc-mingw32';
> on its own, it doesn't correctly specify where to install headers or
> libraries, so the cross-compiler can find them -- that's the job of
> `--prefix', `--includedir', `--libdir' and kin.
> If you only specified `-mno-cygwin' in the CFLAGS, and didn't specify
> at least an appropriate `--prefix', then the portaudio package will most
> likely have installed its headers and libraries into Cygwin's /usr/local
> tree; the MinGW backend won't know to look for them there.
> > I also attempted to compile my binary through MSYS. It returned the
> > same error.
> Again, you have probably neglected to specify an appropriate `--prefix'.
> Most packages default to `--prefix=/usr/local', if you don't specify it
> otherwise; MinGW expects to find headers and libraries in paths relative
> to where the MinGW-GCC binary is installed -- typically `C:/mingw', and
> it doesn't look in the MSYS /usr/local; (indeed, it doesn't know how to
> find that). When you configure any package, which will install headers
> and/or libraries, using MSYS, you are advised to configure with:
> ./configure --prefix=`cd /mingw && pwd -W` ...
> to ensure that headers and libraries are installed where MinGW can find
> them; if you neglect that, then you have to supply an appropriate `-L'
> setting, in the LDFLAGS, when you build any dependent package.
> > Does the error mean that Portaudio has not properly been installed
> > for MinGW, but has been for Cygwin, since that is where I ran the
> > ./configure, make, make install commands?
> It means it has been installed into whatever prefix you specified when
> you ran configure; that probably isn't anywhere that MinGW knows to look
> for it. It may be where Cygwin will look for it, but, because you built
> it for MinGW, it may not be usable by Cygwin.
>  It is somewhat inconvenient to have to add this `--prefix' spec on
> every ./configure command you run in MSYS. To avoid having to do so,
> first review the autoconf documentation on `config.site', then add:
> ac_default_prefix=`exec 2>/dev/null; cd /mingw && pwd -W`
> to the file `/usr/local/share/config.site' in your MSYS tree; (if it
> doesn't exist, you may create it).