Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to compile SOX with LAME under Windows

166 views
Skip to first unread message

Jason Smestad

unread,
Jan 31, 2008, 1:50:47 PM1/31/08
to
How to compile SOX
01/31/2008 - JAS

Prerequisites:
* Windows XP SP2
* Visual Studio 2003
* CMake

Applies to Sox 14.0.1

Section I
To compile SOX by itself

1. Decompress SOX to a folder (C:\projects\sox)
2. Open command line, change to SOX project directory, and type "cmake ."
3. Open "sox.sln" in Visual Studio 2003
4. Right click "ALL_BUILD" in Solution Explorer and choose "Rebuild"
5. A dialog titled "File Modification Detected" will appear. Wait until
the build is done, then choose "Reload"
6. Right click "libsox" in Solution Explorer and choose "Properties"
7. Expand "C/C++" and choose "Preprocessor"
8. Click "..." on the right side of "Preprocessor Definitions" and add
"HAVE_STRING_H" before the first line, press 'Ok' on both dialogs
9. Right click on "sox" in Solution Explorer and choose "Properties"
10. Expand "C/C++" and choose "Preprocessor"
11. Click "..." on the right side of "Preprocessor Definitions" and add
"HAVE_STRING_H" before the first line, press 'Ok' on both dialogs
12. Right click "libsox" and choose "build" and wait until it completes
13. Right click "sox" and choose "build" and wait until it completes
14. Done! You should now have sox.exe :)


Section II
To compile SOX with MP3 support

1. Compile LAME library and also libmad (be sure to choose the correct
CRT, it has to be Multithreaded DLL or Multithreaded Debug DLL if you
are compiling a debug build)
2. Place the LAME static libraries somewhere (libmp3lame.lib and mpglib.lib)
3. Rename libmp3lame.lib to mp3lame.lib and rename libmad.lib to mad.lib
4. Make a folder called lame somewhere and put lame.h in it
5. Open Visual Studio and select Tools->Options
6. Go to Projects->VC++ Directories
7. Under "Show Directories for" choose "Include files"
8. If the path to the folder which contains the folder lame which
contains lame.h isn't there, then add it
9. If the path to the folder containing mad.h isn't there, then add it
10. Select "Library files" under "Show directories for"
11. If the path to mp3lame.lib and mpglib.lib isn't there, then add it
12. If the path to the folder containing mad.lib isn't there, then add it
13. Decompress SOX to a folder (C:\projects\sox)
14. Edit CMakeLists.txt
15. Look on lines 62-64 and find this:

if(NEED_LIBM)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -lm)
endif(NEED_LIBM)

16. Enter a few blank lines after that block and add this text there:

set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} mpglib)

17. Open command line, change to SOX project directory, and type "cmake ."
18. Look at the output of cmake and verify that there are lines that
contain this:

mad_stream_buffer in mad - found
lame_init in mp3lame - found

If it says "not found" you can look at cmakefiles\CMakeError.log to see
what went wrong. Verify that you followed the steps above correctly.

19. Open "sox.sln" in Visual Studio 2003
20. Right click "ALL_BUILD" in Solution Explorer and choose "Rebuild"
21. A dialog titled "File Modification Detected" will appear. Wait until
the build is done, then choose "Reload"
22. Right click "libsox" in Solution Explorer and choose "Properties"
23. Expand "C/C++" and choose "Preprocessor"
24. Click "..." on the right side of "Preprocessor Definitions" and add
"HAVE_STRING_H" before the first line, press 'Ok' on both dialogs
25. Right click on "sox" in Solution Explorer and choose "Properties"
26. Expand "C/C++" and choose "Preprocessor"
27. Click "..." on the right side of "Preprocessor Definitions" and add
"HAVE_STRING_H" before the first line, press 'Ok'
28. Expand "Linker" and choose "Input"
29. Click "..." on the right side of "Additional Dependencies" and add
"mpglib.lib" after the last line, press 'Ok' on both dialogs
30. Right click "libsox" and choose "build" and wait until it completes
31. Right click "sox" and choose "build" and wait until it completes
32. Done! You should now have sox.exe :)

Jack Klein

unread,
Jan 31, 2008, 11:44:17 PM1/31/08
to
On Thu, 31 Jan 2008 12:50:47 -0600, Jason Smestad
<devr...@gmail.com> wrote in comp.lang.c++:

> How to compile SOX
> 01/31/2008 - JAS

[snip]

Who asked you, and who do you think cares?

*plonk*

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

ademets

unread,
Feb 1, 2008, 10:36:30 AM2/1/08
to
On 1 Feb., 05:44, Jack Klein <jackkl...@spamcop.net> wrote:
> On Thu, 31 Jan 2008 12:50:47 -0600, Jason Smestad
> <devrja...@gmail.com> wrote in comp.lang.c++:

>
> > How to compile SOX
> > 01/31/2008 - JAS
>
> [snip]
>
> Who asked you, and who do you think cares?
>
> *plonk*
>
> --
> Jack Klein
> Home:http://JK-Technology.Com
> FAQs for
> comp.lang.chttp://c-faq.com/
> comp.lang.c++http://www.parashift.com/c++-faq-lite/
> alt.comp.lang.learn.c-c++http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html

Actually I care, because I just tried to compile SoX with VS 2008 and
found that manual, so thanks Jason - works like a charm (I never got
14.0.0 to compile, and after the SoX team released the new version I
thought I'd give it another shot). So that's some great timing here
(my project is due on Monday and I have to make some changes to sox..).

Jack Klein

unread,
Feb 1, 2008, 5:47:13 PM2/1/08
to
On Fri, 1 Feb 2008 07:36:30 -0800 (PST), ademets
<alexande...@gmail.com> wrote in comp.lang.c++:

> On 1 Feb., 05:44, Jack Klein <jackkl...@spamcop.net> wrote:
> > On Thu, 31 Jan 2008 12:50:47 -0600, Jason Smestad
> > <devrja...@gmail.com> wrote in comp.lang.c++:
> >
> > > How to compile SOX
> > > 01/31/2008 - JAS
> >
> > [snip]
> >
> > Who asked you, and who do you think cares?
> >
> > *plonk*
> >

> Actually I care, because I just tried to compile SoX with VS 2008 and


> found that manual, so thanks Jason - works like a charm (I never got
> 14.0.0 to compile, and after the SoX team released the new version I
> thought I'd give it another shot). So that's some great timing here
> (my project is due on Monday and I have to make some changes to sox..).

Then you should ask for help wherever "SoX" comes from, or in a
newsgroup that supports VS 2008. It has nothing at all to do with the
C++ language.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for

0 new messages