How to include Portaudio to my project?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to include Portaudio to my project?

Carlton banks
also posted on SO: https://stackoverflow.com/questions/46886033/paerror-not-a-class-or-namespace

I seem to have some problems including portaudio to my project, I guess my error is caused be me not including portaudio accurately to my project. 


My project source tree looks like this

audio$ tree
.
├── audio.cbp
├── CMakeCache.txt
├── CMakeFiles
   ├── 3.2.2
      ├── CMakeCCompiler.cmake
      ├── CMakeCXXCompiler.cmake
      ├── CMakeDetermineCompilerABI_C.bin
      ├── CMakeDetermineCompilerABI_CXX.bin
      ├── CMakeSystem.cmake
      ├── CompilerIdC
         ├── a.out
         └── CMakeCCompilerId.c
      └── CompilerIdCXX
          ├── a.out
          └── CMakeCXXCompilerId.cpp
   ├── audio.dir
      ├── build.make
      ├── cmake_clean.cmake
      ├── CXX.includecache
      ├── DependInfo.cmake
      ├── depend.internal
      ├── depend.make
      ├── flags.make
      ├── link.txt
      └── progress.make
   ├── cmake.check_cache
   ├── CMakeDirectoryInformation.cmake
   ├── CMakeOutput.log
   ├── CMakeTmp
   ├── feature_tests.bin
   ├── feature_tests.c
   ├── feature_tests.cxx
   ├── Makefile2
   ├── Makefile.cmake
   ├── progress.marks
   └── TargetDirectories.txt
├── cmake_install.cmake
├── CMakeLists.txt
├── CMakeLists.txt.user
├── database.cpp
├── database.h
├── main.cpp
├── Makefile
├── match.cpp
├── match.h
├── portaudio
   ├── libportaudio.a
   └── portaudio.h
├── record.cpp
├── record.h
├── spectogram.cpp
└── spectogram.h

7 directories, 45 files
In which I have, as suggested by the portaudio guide,  copy pasted the libportaudio.a and portaudio.h into my project folder. 


My cmakelist looks like this

project(audio)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})

So it should include all the files.. 


but defining a function as such

void record::example()
{
    std::cout << "In example!" << std::endl;
    std::cout << Pa_GetVersion() << std::endl;
}


Is not possible.. , I get an compile error stating that undefined reference to Pa_GetVersion().. 
As if it doesn’t know the existence of this. How do i fix that?

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake