Open personball opened 7 months ago
Does this happen with any header or is specific to pcl?
Does this happen with any header or is specific to pcl?
Thank you for reply.
I have no idea about pcl cpp code or header dependencies, I'm new to cpp.
A minimal project(require pcl-1.14.0 installed) : cppsharp_demo.zip
I had tried with some simple cpp code wrote by myself, and cppsharp works well.
And I find this issue https://github.com/mono/CppSharp/issues/1385 likely same problem but not resolved.
Ok, then it looks like the native Clang parser integration code is crashing somewhere inside the pcl cpp code. The way to debug these is to compile CppSharp and LLVM in debug mode to be able to get accurate stack traces. This is not too difficult but requires a bit of time.
Another approach might be to try to comment includes inside pcl code, until you figure out where exactly the code is crashing.
I try to build from source, but failed.
PS build> & 'C:\Program Files\Git\bin\sh.exe' .\build.sh -configuration Debug -platform x64 -target-framework net8.0
net8.0
Archive llvm-6eb36a-windows-vs2022-x64-Debug.7z already exists.
Using debug LLVM build: C:/CppSharp-1.1/build/llvm/llvm-6eb36a-windows-vs2022-x64-Debug
Using release LLVM build: C:/CppSharp-1.1/build/llvm/llvm-6eb36a-windows-vs2022-x64-Debug
Generating CppSharp build configuration file 'BuildConfig.cs'
Building configurations...
Running action 'vs2022'...
Generated vs2022/projects/CppSharp.Parser.CLI.vcxproj...
Generated vs2022/projects/CLI.CLI.vcxproj...
Generated vs2022/projects/Common.CLI.vcxproj...
Generated vs2022/projects/StandardLib.CLI.vcxproj...
Done (664ms).
正在确定要还原的项目…
已还原 C:\CppSharp-1.1\src\Parser\CppSharp.Parser.csproj (用时 789 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Encodings\Encodings.CSharp.csproj (用时 789 毫秒)。
已还原 C:\CppSharp-1.1\src\Generator\CppSharp.Generator.csproj (用时 591 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\CLI\CLI.Gen.csproj (用时 789 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Encodings\Encodings.Gen.csproj (用时 789 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\VTables\VTables.CSharp.csproj (用时 4 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\StandardLib\StandardLib.Gen.csproj (用时 7 毫秒)。
已还原 C:\CppSharp-1.1\src\CLI\CppSharp.CLI.csproj (用时 19 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\CSharp\CSharp.Gen.csproj (用时 35 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\CSharp\CSharp.CSharp.csproj (用时 6 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\VTables\VTables.Gen.csproj (用时 15 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\CLI\CLI.Tests.CLI.csproj (用时 1.24 秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Common\Common.Tests.CLI.csproj (用时 238 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Common\Common.Tests.CSharp.csproj (用时 288 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\VTables\VTables.Tests.CSharp.csproj (用时 268 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Common\Common.CSharp.csproj (用时 3 毫秒)。
已还原 C:\CppSharp-1.1\src\CppParser\ParserGen\CppSharp.Parser.Gen.csproj (用时 6 毫秒)。
已还原 C:\CppSharp-1.1\src\CppParser\Bindings\CSharp\CppSharp.Parser.CSharp.csproj (用时 5 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Common\Common.Gen.csproj (用时 43 毫秒)。
已还原 C:\CppSharp-1.1\src\CppParser\Bootstrap\CppSharp.Parser.Bootstrap.csproj (用时 28 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.Gen.csproj (用时 5 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\Encodings\Encodings.Tests.CSharp.csproj (用时 1.33 秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.Tests.CSharp.csproj (用时 74 毫秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\CSharp\CSharp.Tests.CSharp.csproj (用时 1.38 秒)。
已还原 C:\CppSharp-1.1\tests\dotnet\StandardLib\StandardLib.Tests.CLI.csproj (用时 539 毫秒)。
已还原 C:\CppSharp-1.1\src\Generator.Tests\CppSharp.Generator.Tests.csproj (用时 576 毫秒)。
3 个项目(共 29 个)是最新的,无法还原。
CppSharp -> C:\CppSharp-1.1\bin\Debug_x64\CppSharp.dll
CppSharp.AST -> C:\CppSharp-1.1\bin\Debug_x64\CppSharp.AST.dll
正在创建库 ..\..\..\bin\Debug_x64\CppSharp.CppParser.lib 和对象 ..\..\..\bin\Debug_x64\CppSharp.CppParser.exp
Parser.obj : error LNK2019: 无法解析的外部符号 LLVMInitializeAArch64TargetInfo,函数 "void __cdecl llvm::InitializeAllTargetInfos(void)" (?InitializeAllTargetIn
fos@llvm@@YAXXZ) 中引用了该符号 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
lldCOFF.lib(Driver.obj) : error LNK2001: 无法解析的外部符号 LLVMInitializeAArch64TargetInfo [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj
]
Parser.obj : error LNK2019: 无法解析的外部符号 LLVMInitializeAArch64Target,函数 "void __cdecl llvm::InitializeAllTargets(void)" (?InitializeAllTargets@llvm@@YA
XXZ) 中引用了该符号 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
lldCOFF.lib(Driver.obj) : error LNK2001: 无法解析的外部符号 LLVMInitializeAArch64Target [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
Parser.obj : error LNK2019: 无法解析的外部符号 LLVMInitializeAArch64TargetMC,函数 "void __cdecl llvm::InitializeAllTargetMCs(void)" (?InitializeAllTargetMCs@ll
vm@@YAXXZ) 中引用了该符号 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
lldCOFF.lib(Driver.obj) : error LNK2001: 无法解析的外部符号 LLVMInitializeAArch64TargetMC [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
Parser.obj : error LNK2019: 无法解析的外部符号 LLVMInitializeAArch64AsmPrinter,函数 "void __cdecl llvm::InitializeAllAsmPrinters(void)" (?InitializeAllAsmPrint
ers@llvm@@YAXXZ) 中引用了该符号 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
lldCOFF.lib(Driver.obj) : error LNK2001: 无法解析的外部符号 LLVMInitializeAArch64AsmPrinter [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj
]
Parser.obj : error LNK2019: 无法解析的外部符号 LLVMInitializeAArch64AsmParser,函数 "void __cdecl llvm::InitializeAllAsmParsers(void)" (?InitializeAllAsmParsers
@llvm@@YAXXZ) 中引用了该符号 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
lldCOFF.lib(Driver.obj) : error LNK2001: 无法解析的外部符号 LLVMInitializeAArch64AsmParser [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
..\..\..\bin\Debug_x64\CppSharp.CppParser.dll : fatal error LNK1120: 5 个无法解析的外部命令 [C:\CppSharp-1.1\build\vs2022\projects\CppSharp.CppParser.vcxproj]
Std-symbols.vcxproj -> C:\CppSharp-1.1\bin\Debug_x64\Std-symbols.dll
CppSharp.Runtime -> C:\CppSharp-1.1\bin\Debug_x64\CppSharp.Runtime.dll
CLI.Native.vcxproj -> C:\CppSharp-1.1\build\gen\CLI\CLI.Native.dll
CSharp.Native.vcxproj -> C:\CppSharp-1.1\build\gen\CSharp\CSharp.Native.dll
Common.Native.vcxproj -> C:\CppSharp-1.1\build\gen\Common\Common.Native.dll
Encodings.Native.vcxproj -> C:\CppSharp-1.1\build\gen\Encodings\Encodings.Native.dll
NamespacesBase.Native.vcxproj -> C:\CppSharp-1.1\build\gen\NamespacesDerived\NamespacesBase.Native.dll
NamespacesDerived.cpp
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27): error C2440: “static_cast”: 无法从“CustomAllo
cator<unsigned int>”转换为“CustomAllocator<_Newfirst>” [C:\CppSharp-1.1\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27): error C2440: with [C:\CppSharp-1.1
\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27): error C2440: [ [C:\CppSharp-1.1\bu
ild\vs2022\projects\NamespacesDerived.Native.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27): error C2440: _Newfirst=std::_C
ontainer_proxy [C:\CppSharp-1.1\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27): error C2440: ] [C:\CppSharp-1.1\bu
ild\vs2022\projects\NamespacesDerived.Native.vcxproj]
(编译源文件“../../../tests/dotnet/NamespacesDerived/NamespacesDerived.cpp”)
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
“CustomAllocator<_Newfirst>::CustomAllocator”: 没有重载函数可以转换所有参数类型
with
[
_Newfirst=std::_Container_proxy
]
C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.h(109,1):
可能是“CustomAllocator<_Newfirst>::CustomAllocator(CustomAllocator<_Newfirst> &&)”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
“CustomAllocator<_Newfirst>::CustomAllocator(CustomAllocator<_Newfirst> &&)”: 无法将参数 1 从“CustomAllocator<unsigned int>”转换为“CustomAllo
cator<_Newfirst> &&”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
原因如下: 无法从“CustomAllocator<unsigned int>”转换为“CustomAllocator<_Newfirst>”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.h(109,1):
或 “CustomAllocator<_Newfirst>::CustomAllocator(const CustomAllocator<_Newfirst> &)”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
“CustomAllocator<_Newfirst>::CustomAllocator(const CustomAllocator<_Newfirst> &)”: 无法将参数 1 从“CustomAllocator<unsigned int>”转换为“const
CustomAllocator<_Newfirst> &”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
原因如下: 无法从“CustomAllocator<unsigned int>”转换为“const CustomAllocator<_Newfirst>”
with
[
_Newfirst=std::_Container_proxy
]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
没有可用于执行该转换的用户定义的转换运算符,或者无法调用该运算符
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
尝试匹配参数列表“(CustomAllocator<unsigned int>)”时
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,27):
模板实例化上下文(最早的实例化上下文)为
C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.h(123,56):
查看对正在编译的 类 模板 实例化“std::vector<unsigned int,CustomAllocator<unsigned int>>”的引用
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(764,19):
在编译 类 模板 成员函数“std::vector<unsigned int,CustomAllocator<unsigned int>>::~vector(void) noexcept”时
C:\CppSharp-1.1\tests\dotnet\NamespacesDerived\NamespacesDerived.h(124,1):
请参阅 "StdFields::StdFields" 中对 "std::vector<unsigned int,CustomAllocator<unsigned int>>::~vector" 的第一个引用
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(767,25): error C2530: “_Alproxy”: 必须初始化引用 [C:\CppSh
arp-1.1\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
(编译源文件“../../../tests/dotnet/NamespacesDerived/NamespacesDerived.cpp”)
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(768,32): error C3536: “_Alproxy”: 初始化之前无法使用 [C:\Cpp
Sharp-1.1\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
(编译源文件“../../../tests/dotnet/NamespacesDerived/NamespacesDerived.cpp”)
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(768,9): error C2672: “_Delete_plain_internal”: 未找 到匹
配的重载函数 [C:\CppSharp-1.1\build\vs2022\projects\NamespacesDerived.Native.vcxproj]
(编译源文件“../../../tests/dotnet/NamespacesDerived/NamespacesDerived.cpp”)
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xmemory(1139,19):
可能是“void std::_Delete_plain_internal(_Alloc &,_Alloc::value_type *const ) noexcept”
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(768,9):
未能使函数模板“void std::_Delete_plain_internal(_Alloc &,_Alloc::value_type *const ) noexcept”专用化
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(768,9):
用下列模板参数:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(768,9):
“_Alloc=int”
StandardLib.Native.vcxproj -> C:\CppSharp-1.1\build\gen\StandardLib\StandardLib.Native.dll
VTables.Native.vcxproj -> C:\CppSharp-1.1\build\gen\VTables\VTables.Native.dll
I tried to install llvm in vs2022 workload, and it's failed to build c++ project CppSharp.CppParser;
And tried to build llvm from source code follow https://github.com/mono/CppSharp/blob/main/docs/LLVM.md, It's failed again.
> & 'C:\Program Files\Git\bin\sh.exe' .\build.sh build_llvm --platform=x64
fail with:
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\LLVM.sln”(默认目标) (1) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\ALL_BUILD.vcxproj.metaproj”(默认目标) (2) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\utils\FileCheck\FileCheck.vcxproj.metaproj”(默认目标) (3) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\FileCheck\LLVMFileCheck.vcxproj.metaproj”(默认目标) (5) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\Support\LLVMSupport.vcxproj.metaproj”(默认目标) (6) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\Support\BLAKE3\LLVMSupportBlake3.vcxproj.metaproj”(默认目 标) (7) ->
“C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\Support\BLAKE3\LLVMSupportBlake3.vcxproj”(默认目标) (225) ->
(_MASM 目标) ->
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\masm.targets(70,5): error MSB3721: 命令“ml64.exe /c /nologo /Fo"LLVMSupportBlake3.d
ir\RelWithDebInfo\blake3_sse2_x86-64_windows_msvc.obj" /D"WIN32" /D"_WINDOWS" /D"NDEBUG" /D"_HAS_EXCEPTIONS=0" /D"GTEST_HAS_RTTI=0" /D"_CRT_SECURE_NO_DEPRECATE" /D"_CRT_SECURE_NO_WARNIN
GS" /D"_CRT_NONSTDC_NO_DEPRECATE" /D"_CRT_NONSTDC_NO_WARNINGS" /D"_SCL_SECURE_NO_DEPRECATE" /D"_SCL_SECURE_NO_WARNINGS" /D"UNICODE" /D"_UNICODE" /D"__STDC_CONSTANT_MACROS" /D"__STDC_FOR
MAT_MACROS" /D"__STDC_LIMIT_MACROS" /D"CMAKE_INTDIR="RelWithDebInfo"" /I "C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\Support\BLAKE3" /I "C
:\CppSharp-1.1\build\llvm\llvm-project\llvm\lib\Support\BLAKE3" /I "C:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\include" /I "C:\CppSharp-1.1\bu
ild\llvm\llvm-project\llvm\include" /W3 /errorReport:prompt /MP /Ta"C:\CppSharp-1.1\build\llvm\llvm-project\llvm\lib\Support\BLAKE3\blake3_sse2_x86-64_windows_msvc.asm"”已退出,返回代码为 1。 [C
:\CppSharp-1.1\build\llvm\llvm-project\llvm-6eb36a-windows-vs2022-x64-RelWithDebInfo\lib\Support\BLAKE3\LLVMSupportBlake3.vcxproj]
0 个警告
1 个错误
已用时间 00:00:38.28
Error: C:/CppSharp-1.1/build/scripts/Utils.lua:35: attempt to call a number value (global 'error')
Do I missing anything to setup development env for CppSharp?
Brief Description
I want to generate csharp bindings for pcl-1.14.0 .
follow the doc:
And
Program.cs
as:run and output:
How can I fix this?
OS: Windows IDE: VS2022
Used headers
Used settings
Target: MSVC
Stack trace or incompilable generated code