monk at rq3.com
2008-Nov-11 17:38 UTC
[Speex-dev] visual studio 2005 - help getting speex workin'
Hey there, I'm having trouble getting speex working with a project that uses it. For some quick background, the game Quake 3 was GPL'ed a while ago. Some programmers decided to throw it into a public svn and improve on it, called it ioquake3. One of the blokes integrated speex into ioquake3 and it works, but I have troubles getting it to compile/link properly with Visual Studio 2005. I am not a highly skilled programmer and am not highly skilled at using Visual Studio, so I apologize if I'm doing something obviously wrong. My development environment is set up according to this step-by-step set of instructions: http://ioquake.org/forums/viewtopic.php?f=12&t=55 There is one .sln file with five .vcproj files attached. Speex is used in the "quake3" project as far as I can tell. In the code, there's an IFDEF called "USE_VOIP". I go to the properties of "quake3" and add "USE_VOIP" to the Preprocessor Directives section and that activates the speex code. And then things don't work out too well. ioquake3 has the speex \libspeex and \include\speex folders integrated as \libspeex\include\speex, which should be fine. I have added my Additional Include Directories to include ..\..\libspeex\include and that seems to work ok. I then set to release build and do a clean and rebuild all, I get linker errors about undefined symbols related to speex. Ok, so I go to the speex website and download the 1.2b3 win32 binaries and use the .lib files there; I put them in the right place and add them to the Additional Dependencies. And everything compiles and links fine except for ONE symbol. Doh! So the guy who integrated speex to ioquake3 used the 1.2rc1 code and the latest .lib's are for the 1.2b3 code. So I'm told, just add the speex .c files to your project and compile them directly. I see that ioquake3 has done this with JPEG support and some other stuff, so I figure what the heck, I'll give it a shot. Under the "quake3" project, I add a new filter called "speex" and shove *.c from \libspeex into there. I try compiling but it wants a preprocessor directive for FLOATING_POINT or FIXED_POINT. Someone else mentioned USE_ALLOCA so I gave both a shot. I ended up with about 800 errors and 800 warnings related to speex files. So, I know it's possible in theory, I'm just having a heck of a time getting things to work. It just magically works using the mingw compiling environment and linux tools, but Visual Studio wants to defeat me. I think if there were .lib files for 1.2rc1 (or 1.2 final whenever it comes out), that would pretty much solve the problem. However, I don't know if anyone will make some .lib files to post on the speex website. If I could figure out how to compile the speex files within the project, .lib files would be a moot point anyway. I'd be happy with either outcome, though. ;) Any ideas or pointers? For those who made it all the way down to the end, thanks very much for your time and for reading this! Monk.
monk at rq3.com
2008-Nov-15 18:00 UTC
[Speex-dev] visual studio 2005 - help getting speex workin'
I got this working. For anyone curious, here's what I ended up doing:> Under the "quake3" project, I add a new filter called "speex" and shove > *.c from \libspeex into there. I try compiling but it wants a > preprocessor directive for FLOATING_POINT or FIXED_POINT. Someone else > mentioned USE_ALLOCA so I gave both a shot. I ended up with about 800 > errors and 800 warnings related to speex files.Looking at the speex 1.2rc1 VS2005 .sln, I found that I shouldn't bother using FLOATING_POINT, FIXED_POINT, or USE_ALLOCA. Instead, I should use HAVE_CONFIG_H. When I did that, the compiler complained that it could not find config.h. I copied config.h from the "win32" folder in speex-1.2rc1.tar.gz into ioquake3's \libspeex folder, then dragged that file to the "speex" Visual Studio filter that I had defined before. After that, I had a bunch of warnings, but no errors. And the compile succeeded. Yay! I see whoever did the Visual Studio files also put in an ignore of warnings 4244, 4305, 4311, 4100, 4127, and those are pretty much the speex-related ones I get: ..\..\code\libspeex\vbr.c(83) : warning C4305: '=' : truncation from 'double' to 'float' ..\..\code\libspeex\vbr.c(88) : warning C4244: '=' : conversion from 'double' to 'float', possible loss of data ..\..\code\libspeex\stereo.c(274) : warning C4100: 'state' : unreferenced formal parameter ...etc. So I assume those are minor and already known. I checked the resulting binary and the VOIP-related variables were active in-game, so that's good enough fer me. I have gotten this working on Win2K with Visual Studio 2005 and will also test it with WinXP and Visual Studio 2008, though I don't anticipate any real differences between the two platforms, now that I got the basic compile going. Thanks again for those who offered suggestions and thanks especially to those who maintain the Visual Studio/win32 files! Monk.
Possibly Parallel Threads
- [Bug 105432] New: [NVE0] Display Freezes but SSH Works When Using OpenGL Applications
- [PATCH] Check for _WIN32 instead of WIN32 in preprocessor checks
- speex-1.2rc1 breaks ABI on OS X
- How to compile speex with XCode (for iPhone App)?
- Speex crashing on ARM with assembler optimization enabled.