-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Can not Build from Source , error when building with cmake, Looking for pthread_create in pthreads - not found #43358
Comments
|
github-actions
bot
added
Needs: Author Feedback
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
and removed
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
labels
Mar 7, 2024
update reproducer |
github-actions
bot
added
Needs: Attention
Issues where the author has responded to feedback.
and removed
Needs: Author Feedback
labels
Mar 7, 2024
Duplicates #37770 |
cortinico
added
Resolution: Duplicate
and removed
Needs: Triage 🔍
Needs: Attention
Issues where the author has responded to feedback.
labels
Mar 7, 2024
windows Platforms can not resolve build from souce? |
Exactly. We don't currently support build from source on Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
windows 10, build form source, cmake fail
[CXX1429] error when building with cmake using D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\src\main\jni\CMakeLists.txt: -- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Found Python: C:/Program Files/Python312/python.exe (found version "3.12.2") found components: Interpreter
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
Steps to reproduce
1.follow the document
https://reactnative.dev/contributing/how-to-build-from-source ,
try build react-native project ,version 0.73.0
and modify settings. gradle
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../node_modules/react-native') {
dependencySubstitution {
substitute(module("com.facebook.react:react-android")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:react-native")).using(project(":packages:react-native:ReactAndroid"))
substitute(module("com.facebook.react:hermes-android")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
substitute(module("com.facebook.react:hermes-engine")).using(project(":packages:react-native:ReactAndroid:hermes-engine"))
}
}
sdk.dir=D:\Software\Android\Sdk
[CXX1429] error when building with cmake using D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\src\main\jni\CMakeLists.txt: -- The C compiler identification is Clang 14.0.6
-- The CXX compiler identification is Clang 14.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: D:/Software/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
-- Found Python: C:/Program Files/Python312/python.exe (found version "3.12.2") found components: Interpreter
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Configuring done
-- Generating done
C++ build system [configure] failed while executing:
@echo off
"D:\Software\Android\Sdk\cmake\3.22.1\bin\cmake.exe" ^
"-HD:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\src\main\jni" ^
"-DCMAKE_SYSTEM_NAME=Android" ^
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
"-DCMAKE_SYSTEM_VERSION=21" ^
"-DANDROID_ABI=x86" ^
"-DCMAKE_ANDROID_ARCH_ABI=x86" ^
"-DANDROID_NDK=D:\Software\Android\Sdk\ndk\25.1.8937393" ^
"-DCMAKE_ANDROID_NDK=D:\Software\Android\Sdk\ndk\25.1.8937393" ^
"-DCMAKE_TOOLCHAIN_FILE=D:\Software\Android\Sdk\ndk\25.1.8937393\build\cmake\android.toolchain.cmake" ^
"-DCMAKE_MAKE_PROGRAM=D:\Software\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\5m92g3t3\obj\x86" ^
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\5m92g3t3\obj\x86" ^
"-DCMAKE_BUILD_TYPE=Debug" ^
"-DCMAKE_FIND_ROOT_PATH=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\.cxx\Debug\5m92g3t3\prefab\x86\prefab" ^
"-BD:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\.cxx\Debug\5m92g3t3\x86" ^
-GNinja ^
"-DREACT_COMMON_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native/ReactCommon" ^
"-DREACT_ANDROID_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid" ^
"-DREACT_BUILD_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build" ^
"-DANDROID_STL=c++_shared" ^
"-DANDROID_TOOLCHAIN=clang" ^
"-DANDROID_PLATFORM=android-21" ^
"-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON"
from D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid
CMake Error in CMakeLists.txt:
Imported target "hermes-engine::libhermes" includes non-existent path
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
The path was deleted, renamed, or moved to another location.
An install or uninstall procedure did not complete successfully.
The installation package was faulty and references files it does not
provide.
CMake Error in D:/Workspace/AwesomeProject61_2_backup/node_modules/react-native/ReactCommon/hermes/executor/CMakeLists.txt:
Imported target "hermes-engine::libhermes" includes non-existent path
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
The path was deleted, renamed, or moved to another location.
An install or uninstall procedure did not complete successfully.
The installation package was faulty and references files it does not
provide.
React Native Version
0.73.0
Affected Platforms
Runtime - Android, Build - Windows
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/ncwuguowei/reproducer-react-native
Screenshots and Videos
C++ build system [configure] failed while executing:
@echo off
"D:\Software\Android\Sdk\cmake\3.22.1\bin\cmake.exe" ^
"-HD:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\src\main\jni" ^
"-DCMAKE_SYSTEM_NAME=Android" ^
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON" ^
"-DCMAKE_SYSTEM_VERSION=21" ^
"-DANDROID_ABI=x86" ^
"-DCMAKE_ANDROID_ARCH_ABI=x86" ^
"-DANDROID_NDK=D:\Software\Android\Sdk\ndk\25.1.8937393" ^
"-DCMAKE_ANDROID_NDK=D:\Software\Android\Sdk\ndk\25.1.8937393" ^
"-DCMAKE_TOOLCHAIN_FILE=D:\Software\Android\Sdk\ndk\25.1.8937393\build\cmake\android.toolchain.cmake" ^
"-DCMAKE_MAKE_PROGRAM=D:\Software\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\5m92g3t3\obj\x86" ^
"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build\intermediates\cxx\Debug\5m92g3t3\obj\x86" ^
"-DCMAKE_BUILD_TYPE=Debug" ^
"-DCMAKE_FIND_ROOT_PATH=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\.cxx\Debug\5m92g3t3\prefab\x86\prefab" ^
"-BD:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\.cxx\Debug\5m92g3t3\x86" ^
-GNinja ^
"-DREACT_COMMON_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native/ReactCommon" ^
"-DREACT_ANDROID_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid" ^
"-DREACT_BUILD_DIR=D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid\build" ^
"-DANDROID_STL=c++_shared" ^
"-DANDROID_TOOLCHAIN=clang" ^
"-DANDROID_PLATFORM=android-21" ^
"-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON"
from D:\Workspace\AwesomeProject61_2_backup\node_modules\react-native\ReactAndroid
CMake Error in CMakeLists.txt:
Imported target "hermes-engine::libhermes" includes non-existent path
in its INTERFACE_INCLUDE_DIRECTORIES. Possible reasons include:
The path was deleted, renamed, or moved to another location.
An install or uninstall procedure did not complete successfully.
The installation package was faulty and references files it does not
provide.
The text was updated successfully, but these errors were encountered: