Thread: Re: [Dev-C++] Linking errors with winmme and dsound libraries.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Damien <g_...@ho...> - 2003-07-15 12:29:56
|
<html><div style='background-color:'><DIV><mailto:dev...@li...?subject=help><mailto:dev...@li...><mailto:dev...@li...?subject=subscribe><mailto:dev...@li...?subject=unsubscribe> <DIV>>Do I </DIV></DIV> <DIV></DIV>>have to re-compile such libraries with devcpp? (I hope I don't <DIV></DIV> <P>>have).</P> <P>Well, I think you might have to. Try the Import MSVC Project feature(go to File->Import), that might make recompiling those other projects easier. If your librbaries were not static, you could use a mingw util called reimp to convert MSVC libraries to Dev-C++ libraries.</P> <P> </P> <DIV></DIV> <DIV></DIV>>g++.exe devcpp/hellotable.o -o "devcpp\hellotableRT.exe" <DIV></DIV>>-L"C:/Dev-Cpp/lib" -L"../../Libraries/tinyAudioLib/devcpp" <DIV></DIV>>-L"../../Libraries/PortaudioMSVC/devcpp" -lkernel32 -luser32 -lgdi32 <DIV></DIV>>-lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid <DIV></DIV>>-lodbc32 -lodbccp32 -lkernel32 -luser32 -lgdi32 -lwinspool <DIV></DIV>>-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 <DIV></DIV>>-lodbccp32 -lwinmm -ldsound -lpablioLIB_mme -ltinyAudioLib <DIV></DIV> <DIV></DIV> <DIV></DIV> <P>If in your new project you get linker errors, try placing -lwinmm, and -ldsound <STRONG>after</STRONG> -lpablioLIB_mme and -ltinyAudioLib. Go into the project options(ALT+P), and then to the Linker Parameters, and change the ordering.</P> <DIV></DIV></mailto:dev...@li...?subject=unsubscribe></mailto:dev...@li...?subject=subscribe></mailto:dev...@li...></mailto:dev...@li...?subject=help></div><br clear=all><hr>The new <a href="http://g.msn.com/8HMOEN/2737??PS=">MSN 8:</a> smart spam protection and 2 months FREE* </html> |
|
From: Gabriel M. <g.m...@in...> - 2003-07-16 14:28:35
|
No Damien, I succeded in making the program executable with the libraries re-built with devcpp. I also succeeded in making a program with a library built with MSVC (but not with such particular libraries, that contain calls to winmm.lib), so devcpp should be compatible with such libraries. I'm afraid that there are some incompatibilities with the winmm.lib provided by MSVC6 and the winmm library provided by mingw. I'm asking if such incompatibility could be avoided by some special command line flag or by slightly modifying my code. Thanks anyway for the answer. Gabrel Damien wrote: > > Well, if you compiled your Libraries/Binaries with Dev-C++ and still get > that linker error, I'm stumped. Go to www.mingw.org > <http://www.mingw.org>, they should have all the info you may want. > Also, go through their FAQs section, or type in that same prob in > Google, see if anything shows up. > > > > >I also tried to link the application with the library binaries > >originally compiled with MSVC, now I only get the following error: > > > >====================== > >Info: resolving __iob by linking to __imp___iob (auto-import) > >../../Libraries/tinyAudioLib/release\tinyAudioLib.lib(./pablioLIB_mme___Win32_Release/pa_win_wmme.obj)(.text+0x165):C:\LibroBoulanger\: > > > >variable '_iob' can't be auto-imported. Please read the > >documentation > >for ld's --enable-auto-import for details. > >make.exe: *** [devcpp/hellotableRT.exe] Error 1 > >Execution terminated > > ------------------------------------------------------------------------ > Add photos to your messages with MSN 8. > <http://g.msn.com/8HMLEN/2749??PS=> Get 2 months FREE*. -- Gabriel Maldonado http://csounds.com/maldonado/home2.htm -- |
|
From: Gabriel M. <g.m...@in...> - 2003-07-15 17:14:24
|
Thanks a lot!!! I changed the order of the libraries in the project options - Linker Parameters and now it compiles OK! Now the order is: -ltinyAudioLib -lpablioLIB_mme -lwinmm -ldsound I could never imagine this would cause of the error, becuase in MSVC the order of the libraries is not significant. I also tried to link the application with the library binaries originally compiled with MSVC, now I only get the following error: ====================== Info: resolving __iob by linking to __imp___iob (auto-import) ../../Libraries/tinyAudioLib/release\tinyAudioLib.lib(./pablioLIB_mme___Win32_Release/pa_win_wmme.obj)(.text+0x165):C:\LibroBoulanger\: variable '_iob' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details. make.exe: *** [devcpp/hellotableRT.exe] Error 1 Execution terminated ====================== have you any idea of what this error means? Where is the "detailed documentation for ld's --enable-auto-import" ? The _iob identifier is not present in the sources of the tinyAudioLib nor in the main program soruce file. Is it possible to get rid of such error in a way or another? thanks again Gabriel |
|
From: <or...@vp...> - 2003-07-17 00:53:42
|
Gabriel Maldonado wrote: > I could never imagine this would cause of the error, becuase in MSVC the > order of the libraries is not significant. This was also the case for GCC (the compiler in Dev-C++) in older versions. I still don't know exactly why they introduced it. As I remember they have done this because of faster "parsing" of libraries: they only need to parse everything once, what was specified on the command line, so there is no need to go through all of them again to resolve remaining undefined references. Anyway, this also has another (in my opinion) good side-effect: this way programmers cannot write cross-referencing libraries. (For example there is -lfoo and -lbar and both reference to each other). Oh well, they can, but then they have to give it on the command line twice: -lfoo -lbar -lfoo -lbar Which is ugly. So keep it in mind: FIRST the library (OR object file, OR surce file) on the command line which USES the stuff, THEN the libraries (OR object files, OR surce files) which CONTAIN the stuff. > I also tried to link the application with the library binaries > originally compiled with MSVC, now I only get the following error: > > ====================== > Info: resolving __iob by linking to __imp___iob (auto-import) > ../../Libraries/tinyAudioLib/release\tinyAudioLib.lib(./pablioLIB_mme___Win32_Release/pa_win_wmme.obj)(.text+0x165):C:\LibroBoulanger\: > > variable '_iob' can't be auto-imported. Please read the documentation > for ld's --enable-auto-import for details. > make.exe: *** [devcpp/hellotableRT.exe] Error 1 > Execution terminated > ====================== > > have you any idea of what this error means? Where is the "detailed > documentation for ld's --enable-auto-import" ? The _iob identifier is > not present in the sources of the tinyAudioLib nor in the main program > soruce file. Is it possible to get rid of such error in a way or another? Well :) This error caused me hours of swearing, until I realised that this is a BUG. Not always, but these errors are because of a 10 months old bug, which is not fixed, not matter how I write that f*ckin' bug-report. Is tinyAudioLib a DLL? In that case, specify the DLL DIRECTLY with the libraries (full path!). This is really odd, I know, but in most of the cases, GCC tends not work correctly with import libraries, especially if they are C++. However, it works perfectly with the DLL directly. This is odd indeed. Good luck! -- Greetings, Balázs |
|
From: Gabriel M. <g.m...@in...> - 2003-07-17 13:10:08
|
> Well :) > This error caused me hours of swearing, until I realised that this is a > BUG. Not always, but these errors are because of a 10 months old bug, > which is not fixed, not matter how I write that f*ckin' bug-report. > Is tinyAudioLib a DLL? NO, it is a static library. in that case, specify the DLL DIRECTLY with the > libraries (full path!). I noticed another DevC++ bug: when I override the build commands for a determinate source file (In projectOptions/Files tab), the directory path for such file is lost, causing a compiler error because the compiler cannot find it. So I have to specify the full path of the file in the overriding command. |