Discussion:
[SoX-devel] building sox library for Windows
sudha krishna
2014-07-23 02:20:28 UTC
Permalink
Hi All,

I am writing a windows application, that needs Sox library.

I have been trying to build LibSoX.lib based on the sources for Version 14.4.1 and running into issues.

I am using Visual Studio, and used the Sox.soln file here: \sox-code-fb412eb21ecea7d73380ef854b743e8c35d33422\msvc10\SoX.soln.

After disabling the features that are not needed in \msvc10\soxconfig.h, I was able to build LibSoX.lib and SoX.exe.

msvc10\Debug\lib\LibSoX.lib, size is 2963 Kb.

msvc10\Debug\SoX.exe, size is 1401 Kb.


I tested the above SoX.exe, for doing sample rate conversion from 44.1K to 16K, it worked fine, with command below.
sox wave_file_correct.wav -b 16 recital.wav channels 1 rate 16k

But when I try to link the msvc10\Debug\lib\LibSoX.lib, size is 2963 Kb, with my application, ran into linker errors, for all the sox_* functions.

I am just puzzled, since the SoX.exe which is linking with the LibSoX.lib is working fine, why is that LibSoX.lib has undefined symbols for sox_* functions.

As an alternate option, can someone provide or point me to a link, which has pre-build LibSoX.lib library for Windows, that I can use.

Some of the linker errors listed below.
1>wave_in_thread.obj : error LNK2028: unresolved token (0A0003E4) "extern "C" int __cdecl sox_init(void)" (?sox_init@@$$J0YAHXZ) referenced in function "int __cdecl `anonymous namespace'::sox_test_function3(void)" (?sox_test_function3@?A0x40915a7a@@$$FYAHXZ)
1>wave_in_thread.obj : error LNK2028: unresolved token (0A0003FE) "extern "C" int __cdecl sox_close(struct sox_format_t *)" (?sox_close@@$$J0YAHPEAUsox_format_t@@@Z) referenced in function "int __cdecl `anonymous namespace'::sox_test_function3(void)" (?sox_test_function3@?A0x40915a7a@@$$FYAHXZ)
1>wave_in_thread.obj : error LNK2028: unresolved token (0A00041B) "extern "C" struct sox_effect_t * __cdecl sox_create_effect(struct sox_effect_handler_t const *)" (?sox_create_effect@@$$J0YAPEAUsox_effect_t@@PEBUsox_effect_handler_t@@@Z) referenced in function "int __cdecl `anonymous namespace'::sox_test_function3(void)" (?sox_test_function3@?A0x40915a7a@@$$FYAHXZ)


Thanks,

Krishna

Loading...