Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: 'cpu-features.h' file not found #106

Closed
leshchenko opened this issue Feb 5, 2020 · 6 comments
Closed

Fatal error: 'cpu-features.h' file not found #106

leshchenko opened this issue Feb 5, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@leshchenko
Copy link

leshchenko commented Feb 5, 2020

I downloaded lib and copied it to my project directory. My CMakeLists.txt :

 cmake_minimum_required(VERSION 3.6)

 add_subdirectory(cpu_features)

 add_library(
     myLib
     SHARED
     app/src/main/cpp/test.cpp
)
 
 link_libraries(myLib cpu_features)

My test.cpp file:

#include "test.h"
#include <cpu-features.h>

I have 10: fatal error: 'cpu-features.h' file not found error.

Please tell me what I'm doing wrong.
Thanks.

@Mizux
Copy link
Collaborator

Mizux commented Feb 5, 2020

there is no cpu-features.h see https://github.com/google/cpu_features/tree/master/include

note: You should use target_link_libraries() IMHO

@Mizux Mizux added the help wanted Extra attention is needed label Feb 5, 2020
Mizux added a commit that referenced this issue Feb 5, 2020
For customers using add_subdirectory() approach

related to #106
@leshchenko
Copy link
Author

@Mizux Thanks for the quick reply. Could you please help me in case I want to use cpu-features.h from https://github.com/google/cpu_features/tree/master/ndk_compat ?

@Mizux
Copy link
Collaborator

Mizux commented Feb 5, 2020

in this cas e you should have something like this I guess (not tested):

...
add_subdirectory(cpu_features/ndk_compat)

 add_library(
     myLib
     SHARED
     app/src/main/cpp/test.cpp
)
  target_link_libraries(myLib ndk_compat)

@leshchenkoEk
Copy link

@Mizux Unfortunately it doesn't work

gchatelet pushed a commit that referenced this issue Feb 6, 2020
For customers using add_subdirectory() approach

related to #106
@gchatelet
Copy link
Collaborator

@leshchenkoEk can you confirm that it works now?

@gchatelet gchatelet removed the help wanted Extra attention is needed label Sep 21, 2020
Mizux added a commit to Mizux/cpu_features that referenced this issue Sep 21, 2020
@Mizux
Copy link
Collaborator

Mizux commented Sep 21, 2020

Should be fixed by my patch see the comment in the PR...

@gchatelet gchatelet added this to the Release v0.5.0 milestone Sep 21, 2020
@gchatelet gchatelet added the bug Something isn't working label Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants