Skip to content

CPP代码编译失败 #58

@kunger97

Description

@kunger97

描述 / Description

@rnoh/react-native-openharmony版本0.72.75
DevEco Studio Build Version: 5.1.1.840
targetSdkVersion: 5.1.1
在编译时CPP编译失败
好像是codegen生成的胶水代码有问题?

hvigor ERROR: Failed :entry:default@BuildNativeWithNinja...
hvigor ERROR: Exceptions happened while executing: ninja: Entering directory `D:\RNCodes\NearLink_RN\harmony\entry.cxx\default\default\debug\arm64-v8a'
[0/2] Re-checking globbed directories...
[1/2] Linking CXX shared library D:\RNCodes\NearLink_RN\harmony\entry\build\default\intermediates\cmake\default\obj\arm64-v8a\librnoh_app.so
FAILED: D:/RNCodes/NearLink_RN/harmony/entry/build/default/intermediates/cmake/default/obj/arm64-v8a/librnoh_app.so
C:\WINDOWS\system32\cmd.exe /C "cd . && "D:\Program Files\Huawei\DevEco Studio\sdk\default\openharmony\native\llvm\bin\clang++.exe" --target=aarch64-linux-ohos --gcc-toolchain="D:/Program Files/Huawei/DevEco Studio/sdk/default/openharmony/native/llvm" --sysroot="D:/Program Files/Huawei/DevEco Studio/sdk/default/openharmony/native/sysroot" -fPIC -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie -O0 -g -fno-limit-debug-info --rtlib=compiler-rt -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--warn-shared-textrel -Wl,--fatal-warnings -lunwind -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,librnoh_app.so -o D:\RNCodes\NearLink_RN\harmony\entry\build\default\intermediates\cmake\default\obj\arm64-v8a\librnoh_app.so @CMakeFiles\rnoh_app.rsp && cd ."
ld.lld: error: undefined symbol: rnoh::RNGestureHandlerModule::RNGestureHandlerModule(rnoh::ArkTSTurboModule::Context, std::__n1::basic_string<char, std::__n1::char_traits, std::__n1::allocator>)

referenced by shared_ptr.h:294 (D:/Program Files/Huawei/DevEco Studio/sdk/default/openharmony/native/llvm/bin/../include/libcxx-ohos/include/c++/v1/__memory/shared_ptr.h:294)
CMakeFiles/rnoh_app.dir/PackageProvider.cpp.o:(std::__n1::__shared_ptr_emplace<rnoh::RNGestureHandlerModule, std::__n1::allocatorrnoh::RNGestureHandlerModule>::__shared_ptr_emplace[abi:v15004]<rnoh::ArkTSTurboModule::Context&, std::__n1::basic_string<char, std::__n1::char_traits, std::__n1::allocator> const&>(std::__n1::allocatorrnoh::RNGestureHandlerModule, rnoh::ArkTSTurboModule::Context&, std::__n1::basic_string<char, std::__n1::char_traits, std::__n1::allocator> const&))
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
A 'undefined symbol' error has occurred.

hvigor ERROR: BUILD FAILED in 2 s 493 ms

复现步骤 / Steps to reproduce

  1. 搭建rnoh环境
  2. 编译debug包

库版本 / Library version

2.14.17-rc.0

React Native OpenHarmony version

0.72.75

构建类型 / Build type

Debug app & dev bundle

设备 / Device

Real device

设备版本 / Device model

Meta70(5.1.0.150)

已悉知 / Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions