1

I'm trying to implement a steganography scheme in Opus audio file using pulse data from the opus bitstream. I've installed the source code for the Opus codec, and I realized that I only need the SILK part for my requirements. I need to compile some C files from the source code in order to execute them from my Python script.

Now, I've tried compiling the "decode_pulses.c" and "encode_pulses.c" files from the SILK source code with GCC, but I keep facing the same error over and over again. When I try compiling the "decode_pulses.c" file, for example, I get the following error message from GCC:

C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0x5c): undefined reference to ec_dec_icdf' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: <some-path>\AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0xd0): undefined reference to ec_dec_icdf' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0x130): undefined reference to ec_dec_icdf' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: <some-path>\AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0x1a0): undefined reference to silk_shell_decoder' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0x266): undefined reference to ec_dec_icdf' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: <some-path>\AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.text+0x2fa): undefined reference to silk_decode_signs' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.rdata$.refptr.silk_lsb_iCDF[.refptr.silk_lsb_iCDF]+0x0): undefined reference to silk_lsb_iCDF' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: <some-path>\AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.rdata$.refptr.silk_pulses_per_block_iCDF[.refptr.silk_pulses_per_block_iCDF]+0x0): undefined reference to silk_pulses_per_block_iCDF' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: \AppData\Local\Temp\ccI9UV4i.o:decode_pulses.c:(.rdata$.refptr.silk_rate_levels_iCDF[.refptr.silk_rate_levels_iCDF]+0x0): undefined reference to silk_rate_levels_iCDF' C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function main': C:/crossdev/src/mingw-w64-v8-git/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain' collect2.exe: error: ld returned 1 exit status

I understand that the problem is missing references, such as function definitions, but I don't know how to fix these undefined references. Also, there is no header file error, so I can assume that all needed headers are included without any problem.

Can someone explain to me what this error message is and how to resolve it? Recall that my goal is to compile the "decode_pulses.c" file from the SILK codec source code in order to execute it from my Python script.

Thanks!

  • Evidently, you have not identified *all* of the source files you need. The diagnostics tell you which functions are not found, so if you want to continue down this route then locate the sources that provide those, and include them in your build too. You may need to perform several rounds of this. – John Bollinger Apr 22 '23 at 14:33
  • But the usual way to do this sort of thing is to use the whole library, built via its own build system, instead of trying to pick and choose pieces from it to build separately. – John Bollinger Apr 22 '23 at 14:34
  • Thank you, John! Could you expain to me how to build the whole library? Here is the link for the source code, should you find it interesting: https://opus-codec.org/release/stable/2019/04/12/libopus-1_3_1.html – NoobMaster69 Apr 22 '23 at 15:01
  • Take a look at [\[SO\]: How do I ask a good question?](https://stackoverflow.com/help/how-to-ask) or **[\[SO\]: How to create a Minimal, Reproducible Example (reprex (mcve))](https://stackoverflow.com/help/minimal-reproducible-example)**. Post the commands as well, not just their outputs. Also indicate what source files are you building. Based on your error, one of the problems seems to be ***-shared*** not being passed to *GCC*. – CristiFati Apr 22 '23 at 15:21
  • @NoobMaster69, surely the library source comes with build instructions, and / or its online docs provide instructions. Follow those. – John Bollinger Apr 22 '23 at 16:10
  • Thanks a lot, @JohnBollinger! I've followed the build instructions, but now I'm facing a different problem. The .so file resulting from the building process does not contain the specific functionality I need, which is a low-level functionality of the codec. Perhaps it's part of one of the high-level functions but I don't know how to find it. – NoobMaster69 Apr 24 '23 at 10:19
  • Also, I think it would be more efficient to build only the part of the source code I need, but I don't know whether that's a possibilty. That's why I tried to compile this file only instead of trying to build the whole thing. – NoobMaster69 Apr 24 '23 at 10:20

0 Answers0