PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.51k stars 307 forks source link

(MSVS) .lib and .dll not read properly by external use (paex_ocean_shore.c) #959

Open samfan0429 opened 2 months ago

samfan0429 commented 2 months ago

AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_InitializeRingBuffer referenced in function main AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_GetRingBufferReadAvailable referenced in function "int cdecl patestCallback(void const ,void ,unsigned long,struct PaStreamCallbackTimeInfo const ,unsigned long,void )" (?patestCallback@@YAHPEBXPEAXKPEBUPaStreamCallbackTimeInfo@@K1@Z) AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_WriteRingBuffer referenced in function "int __cdecl patestCallback(void const ,void ,unsigned long,struct PaStreamCallbackTimeInfo const ,unsigned long,void )" (?patestCallback@@YAHPEBXPEAXKPEBUPaStreamCallbackTimeInfo@@K1@Z) AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_ReadRingBuffer referenced in function "int cdecl patestCallback(void const ,void ,unsigned long,struct PaStreamCallbackTimeInfo const ,unsigned long,void )" (?patestCallback@@YAHPEBXPEAXKPEBUPaStreamCallbackTimeInfo@@K1@Z) AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_AllocateZeroInitializedMemory referenced in function "struct OceanWave * __cdecl InitializeWave(double,float,float,float)" (?InitializeWave@@YAPEAUOceanWave@@NMMM@Z) AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_FreeMemory referenced in function main AudioProcessing1.obj : error LNK2019: unresolved external symbol PaUtil_GetTime referenced in function main C:\Users\USER\Desktop\project\signals\AudioProcessing1\x64\Debug\AudioProcessing1.exe : fatal error LNK1120: 7 unresolved externals

So the .lib and .dll are compiled fine. But when I try to take the two files to run it on a separate project, it did not work. I used the "paex_ocean_shore" example to test it. "paex_pink" worked fine but I am wondering what is the problem. May I know where to start looking in the library compilation? I used a very ad-hoc method of re-defining them in a new ".c" files and running the external software to make it work. It seems that something is missing upon creating the library files.

RossBencina commented 1 month ago

Related: #226

There are a few faulty examples that use PortAudio internal APIs, paex_ocean_shore is one of them. The only way to compile these examples is by static-linking the PortAudio code that contains the internal APIs.