J
Jason Smestad
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
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