Reputation: 1
I try to install PortAudio for Window. And nothing works.
I tryed any way on the internet, PortAudio tutorials, any youTube video, asked friends, social networks, ChatGPT and nothing works. Some installation do not works, and the other that works, after the instalation, the code outputing this:
main.cpp:1:11: fatal error: portaudio.h: No such file or directory
Some of the ways I tryed:
1.
PS *project folder*> cd build
PS *project folder*\build> cmake -G "MinGW Makefiles" *portaudio folder*
PS *project folder*\build> mingw32-make
*project folder*\build>mingw32-make install
cd lib/portaudio ./configure *PortAudio tgz file* | tar -xz -C lib
tar: Error opening archive: Fail ed to% op en '\T\.\toapet0'a
tar -xvzf *PortAudio .tgz file* *project folder*
PortAudio .sln file
Copy PortAudio folder to project directory
cmake software (Not worked at all)
I tryed to do some if this commends using the IDE terminal, CMD (Administrator mode), or in a makefile code.
I tryed to write a CMakeLists.txt file, but i am not sure I did it right.
I also installed chocolatey (Using Powershell, for "make" command), msys, mingw, and cmake.
Please, Anyone that can help me to make it work? It can works on any IDE That runs C++, I don't care which (I have VS, VS Code and CodeBlocks, but i am open for anything).
Thank you! :)
Update edit:
I tryed to use again option number 1 (cmake -G "MinGW Makefiles"), And i was writing an execute function inside cmake defult MakeFile:
execute_run: main.cpp
g++ -o $@ $^ -I./portaudio/include ./libportaudio.a
(I can't copy the whole code here, because it is too long)
I use the terminal to run:
make execute_run
./execute_run
It is working when there is no PortAudio command in the code main.cpp, but when i put a PortAudio command (Pa_...), It is output this:
make execute_run
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:3: execute_run] Error 1
./execute_run
./execute_run : The term './execute_run' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
Upvotes: 0
Views: 609