Today I'm going to show how to configure it visual studio programming environment.
Working environment
Windows 8.1
Visual studio 11
Development Tools
- MinGW C++ compiler Download
- cmake Download (make sure to download binary distributions)
- Aquila Download
Library Configuration
- Install MinGW C++ compiler. During installation , select “C++ Compiler” and “MSYS Basic System” for installation
- Add system PATH to "c:/mingw/bin" (Right click on my computer-> Properties->Advance system settings->Environment variable -> select path and click edit) example
- Install Cmake
- unzip Aquila to C:\Aquila-src
- Run cmake GUI tool
- Choose C:\Aquila-src\ as source
- Choose the destination, C:\Aquila-build ,This is where to build the binaries
- Press Configure button, choose MinGW Makefiles as the generator.(then in red highlighted area We can choose many options but it's better to use default options if you are beginner)
- Press the Configure button again then press the Generate button
- Exit the cmake program when the generating is done
- Run the command line mode (cmd.exe) and go to the destination directory Aquila-build (type :- cd /Aquila-build)
- Type "mingw32-make". You can see a progress of building binaries. If the command is not found error occur problem is in system path (step 2)
- Then type "mingw32-make install" (you can see install path .we need it in next step)
In addition to this we need to do small one thing .That is we need to add these 2 files to your install directly (default directly C:\Program Files (x86)\Aquila\lib)
**I try this few days and this is not work for me .then I found this 2 files need to place in that directly for work this library
Create Project
- Open Visual Studio IDE
- Create new Console Application
- Go to project properties (Project-> Properties)
- Go to C/C++ -> General then add path of "include" to Additional Include Directories (example :- C:\Program Files (x86)\Aquila\include)
- Go to linker-> General then add path of "lib" to Additional Library Directories (example:- C:\Program Files (x86)\Aquila\lib)
- Go to linker-> input then add library files to Additional Dependencies (Add Aquila.lib ,Ooura_fft.lib )
Implementation
Then run this code
#include "aquila/global.h" #include "aquila/source/generator/SineGenerator.h" #include "aquila/transform/FftFactory.h" #include "aquila/tools/TextPlot.h" int main() { // input signal parameters const std::size_t SIZE = 64; const Aquila::FrequencyType sampleFreq = 2000; const Aquila::FrequencyType f1 = 125, f2 = 700; Aquila::SineGenerator sineGenerator1 = Aquila::SineGenerator(sampleFreq); sineGenerator1.setAmplitude(32).setFrequency(f1).generate(SIZE); Aquila::SineGenerator sineGenerator2 = Aquila::SineGenerator(sampleFreq); sineGenerator2.setAmplitude(8).setFrequency(f2).setPhase(0.75).generate(SIZE); auto sum = sineGenerator1 + sineGenerator2; Aquila::TextPlot plt("Input signal"); plt.plot(sum); // calculate the FFT auto fft = Aquila::FftFactory::getFft(SIZE); Aquila::SpectrumType spectrum = fft->fft(sum.toArray()); plt.setTitle("Spectrum"); plt.plotSpectrum(spectrum); return 0; }
and you will get an output if you get error about "LNK2019 error c++ unresolved external symbol"
Go to BUILD->Configuration Manager and change platform to 64 bit
If have any question please post a comment .This post written by using my experience.so sometimes there can be simple approach than this.Please be kind enough to mention that one also Thank you :)
***Update If you have a trouble with building an own library you can try my pre-build library . I have only tested 64bit lib files but I already added 32bit versions.Try and please kind enough to mentioned is this library works fine or not
Reference official website
27 comments:
Is MinGW C++ compiler needed for VS2010 installation aswell? I'm trying to work with Aquila and am facing trouble using it with VS2010.
I don't think so. VS has inbuilt compiler for C++.In my case I use MinGw for create library files of Aquila.Can you specify exact trouble that you faced then may be I can help you to overcome it
It works well. Thank you.
when i configure the the files using cmake gui it gives error "libgmp-10.dll file missing"
Hi Huzaifa,
Sorry for late response .Did you add MinGW path to system variable? (step2)
Thanks for your concern
this problem has been resolved but when i run the code following errors occurred.
Error2:error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in ConsoleApplication3.obj ..\Aquila.lib(SignalSource.obj)
Error :error LNK1319: 6 mismatches detected
please tell me how to resolve these error
What is the version of your Visual studio?
And also make sur you are running x64 project
yep I have changed the Platform to x64.. working on VS 2013
problem has been resolved by changing the platform toolset to Visual Studio 2012 (v110)
Hi Nipuna Shanthidewa ..
i have followed the steps as you have mentioned in your blog properly(even step 2).. but sir when i try to configure the the files using cmake gui it gives error "libgmp-10.dll file missing".. even then i let the flow going.. i.e; i configure it and then generate.. on step 11 i write command on GitBash command window but error coming "mingw32-make: command not found" ...
Hi @asiyah,
Sorry for late response.I think still problem is System path .Can you please check you add it correctly to SYSTEM PATH not path .And please restart you computer.
em trying to calculate mfcc and dtw using aquila. but when i execute the following code
void main()
{
int frame_size =256;
Aquila::WaveFile waveIn0("a_converted.wav");
Aquila::FramesCollection frameCollection0(waveIn0, frame_size);
vector> dtwdt0;
Aquila::Mfcc mfcc0(frame_size);
for (int i=0; i mfccValues = mfcc0.calculate(frame);
dtwdt0.push_back(mfccValues);
}
this exception occurred.
vector subscript out of range
File: c:\program files\microsoft visual studio 8\vc\include\vector
Line: 1124
what could be the issue? please help
Sorry guys currently i'm not touching in this audio processing implementation.I'll try my best to help you
6.Choose C:\Aquila-src\ as source..
i can't find "as source"
When running cmake to configure, it floats called "error in configuration process, project file may be invalid"
Hi 우준김,
In this tutorial in step 5 i have add image of cmake interface
http://nip-saga.blogspot.com/2015/01/Configure-eclipse-with-open-CV.html
In that you can see "Where is the source code" field
Thank you
Hi, i receive an error when building the sample file.
- LINK : fatal error LNK1104: cannot open file 'Aquila.lib'
I did add "Aquila.lib" and "Ooura_fft.lib" in Input->Additional Dependencies
Could you help me with this error?
And also the link for downloading the two needed files to add them in the installed directory are no more available.
THanks a lot
Hi, again. At the step including "Aquila.lib" and "Ooura_lib.lib", I do not have these ".lib" files. I only have "libAquila.a" and "libOoura_fft.a". How can I get the ".lib" files as in your instructions?
I tried to include "libAquila.a" instead of "Aquila.lib". The error "LINK : fatal error LNK1104: cannot open file 'Aquila.lib'" is no longer showed, however the error "LNK2019 unresolved external symbols" occured. (I did switch the project into x64 compiler).
Any tips please. Thanks
Hi my dear friends ,
Sorry for late response You can download these libs from this repository https://github.com/Nipuna-saga/Aquila-Libs
Thanks
Hi Nipuna, can you tell which two additional files to paste in lib folder? your link is redirecting to your git repo and not just files.
Hey Neha,
please note this location https://github.com/Nipuna-saga/Aquila-Libs/tree/master/Aquila/lib/x86/Debug
This is for 32 bit Debug version projects
Choose your files like this according to your requirement
Thanks
Thank you, Nipuna :)
I have followed all the steps and included the 2 .lib files as well. Then I tried to run the code in Visual Studio 12 and got this linking error:
"Error 1 error LNK1181: cannot open input file 'Aquila.lib'"
Please help me resolve it.
Hi Shreyasi,
I think this may help https://support.microsoft.com/en-us/kb/815645
please help
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
Install configuration...
CMake Error at cmake_install.cmake:31 :
file cannot create directory: C:/Program Files/Aquila.lib. Maybe need
administrative privileges.
Makefile:104: recipe for target 'install' failed
ming32-make: ***[install] Error 1
PLEASE HELP!!!
Windows 7
Hi, can you please clarify what this means? "In addition to this we need to do small one thing .That is we need to add these 2 files to your install directly (default directly C:\Program Files (x86)\Aquila\lib)"
Post a Comment