Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

std::_bind is not compatible with std::function #7

Open
SmartyNance opened this issue May 30, 2018 · 3 comments
Open

std::_bind is not compatible with std::function #7

SmartyNance opened this issue May 30, 2018 · 3 comments

Comments

@SmartyNance
Copy link

if (error == AAUDIO_ERROR_DISCONNECTED){
std::function<void(void)>

restartFunction = std::bind(&AudioEngine::restart,
static_cast<AudioEngine *>(userData));

        new std::thread(restartFunction);
}

Went over the whole file multiple times, and I can't find any difference from what is in your tutorial, but the block of text in the middle always shows an error

@dturner
Copy link
Contributor

dturner commented Jun 5, 2018

Thanks very much for filing this issue - and sorry that you ran into it. I believe something changed in the NDK which means that you now need to explicitly link against libandroid which can be done within CMakeLists.txt by adding android to the list of target_link_libraries

@dturner
Copy link
Contributor

dturner commented Jun 5, 2018

I thought that was the problem but having now removed libandroid from the list of libraries the app still compiles. Please could you post the compilation error you're receiving. I'll try cloning from scratch to see if I can reproduce.

@SmartyNance
Copy link
Author

Thanks for getting back to me!
It’s “Class ‘std::_bind<void(AudioEngine::)(),AudioEngine>’ is not compatible with class ‘std::function <void()>”

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants