PortAudio/portaudio

Compilation by MSVS for Windows Failed

Opened this issue · 6 comments

\src\os\win\pa_win_util.c(174): error C2143: syntax error : missing ';' before 'type'
\src\os\win\pa_win_util.c(175): error C2065: 'msg' : undeclared identifier
\src\os\win\pa_win_util.c(175): warning C4047: 'function' : 'LPSTR' differs in levels of indirection from 'int'
\src\os\win\pa_win_util.c(175): warning C4024: 'WideCharToMultiByte' : different types for formal and actual parameter 5
\src\os\win\pa_win_util.c(176): error C2065: 'msg' : undeclared identifier
\src\os\win\pa_win_util.c(176): warning C4047: 'function' : 'const char *' differs in levels of indirection from 'int'
\src\os\win\pa_win_util.c(176): warning C4024: 'PaUtil_SetLastHostErrorInfo' : different types for formal and actual parameter 3

pa_win_wasapi.c(1980): error C2143: syntax error : missing ';' before 'type'
pa_win_wasapi.c(1980): error C2143: syntax error : missing ';' before 'type'
pa_win_wasapi.c(1980): error C2143: syntax error : missing ')' before 'type'
pa_win_wasapi.c(1980): error C2143: syntax error : missing ';' before 'type'
pa_win_wasapi.c(1980): error C2065: 'i' : undeclared identifier
wasapi\pa_win_wasapi.c(1980): warning C4018: '<' : signed/unsigned mismatch
pa_win_wasapi.c(1980): warning C4552: '<' : operator has no effect; expected operator with side-effect
pa_win_wasapi.c(1980): error C2059: syntax error : ')'
pa_win_wasapi.c(1981): error C2065: 'i' : undeclared identifier
pa_win_wasapi.c(1981): error C2143: syntax error : missing ';' before '{'
pa_win_wasapi.c(1982): error C2065: 'i' : undeclared identifier
pa_win_wasapi.c(2222): error C2143: syntax error : missing ';' before 'type'
pa_win_wasapi.c(2223): error C2275: 'PaWasapiDeviceInfo' : illegal use of this type as an expression
pa_win_wasapi.c(505) : see declaration of 'PaWasapiDeviceInfo'
pa_win_wasapi.c(2223): error C2065: 'loopbackWasapiInfo' : undeclared identifier
pa_win_wasapi.c(2225): error C2065: 'loopbackDeviceInfo' : undeclared identifier
pa_win_wasapi.c(2225): warning C4047: 'function' : 'PaDeviceInfo *' differs in levels of indirection from 'int'
pa_win_wasapi.c(2225): warning C4024: 'FillLooopbackDeviceInfo' : different types for formal and actual parameter 2
pa_win_wasapi.c(2225): error C2065: 'loopbackWasapiInfo' : undeclared identifier
pa_win_wasapi.c(2225): warning C4047: 'function' : 'PaWasapiDeviceInfo *' differs in levels of indirection from 'int'
pa_win_wasapi.c(2225): warning C4024: 'FillLooopbackDeviceInfo' : different types for formal and actual parameter 3
pa_win_wasapi.c(2231): error C2065: 'loopbackDeviceInfo' : undeclared identifier
pa_win_wasapi.c(2231): warning C4047: '=' : 'PaDeviceInfo *' differs in levels of indirection from 'int'

pa_win_ds.c(2033): error C2143: syntax error : missing ';' before 'const'
pa_win_ds.c(2038): error C2065: 'nativeFormats' : undeclared identifier
pa_win_ds.c(2048): error C2065: 'nativeFormats' : undeclared identifier
pa_win_ds.c(2359): error C2061: syntax error : identifier 'QueryOutputSpace'
pa_win_ds.c(2359): error C2059: syntax error : ';'
pa_win_ds.c(2359): error C2059: syntax error : 'type'
pa_win_ds.c(2492): warning C4013: 'QueryOutputSpace' undefined; assuming extern returning int

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Given that our CI is passing without error, we need a lot more information here:

What MSVS version? How are you building PortAudio? Are you using the shipped, project files, CMake or some other build method?

vs2010 The files were added to a common console C++ project in the usual standard way. But this unfortunately does not work.
I temporarily got around the problem by using a dll, but it's not a solution. With the dll everything is assembled and works fine.

The files were added to a common console C++ project in the usual standard way

I'm not sure what "the usual standard way" is but PortAudio sources will not build without the correct build settings. You'd need to at least make sure that you are setting all of the include paths and defines correctly in the project build settings.

Can you try CMAKE gui?

I can't use CMake. Because the whole huge project is built in Visual Studio.

ah, CMake GUI will Create VisutlStudio Project file. Once you could try CMake, It will work.
CMake -> Customize Build Option -> VisualStudio Project File.
Make library and reference it from your main project.