voltagex
voltagex
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
I'm still musing about what the "easiest" API to generate bindings against would be. I guess there's always SWIG
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
This feels like going around the long way to learning C.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
this is very much appreciated, although I am definitely at information overload now, and will go play some video games instead.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
Diagnostics for '/home/voltagex/src/systemd/src/systemd/sd-device.h':
/usr/include/x86_64-linux-gnu/asm/stat.h:83:8: error: redefinition of 'stat'
/usr/include/x86_64-linux-gnu/asm/stat.h:132:16: error: expected ';' at end of declaration list
/usr/include/x86_64-linux-gnu/asm/stat.h:133:16: error: expected ';' at end of declaration list
/usr/include/x86_64-linux-gnu/asm/stat.h:134:16: error: expected ';' at end of declaration list
/usr/src/linux-headers-6.10.0-rc2/include/linux/stddef.h:11:2: error: expected identifier
/usr/src/linux-headers-6.10.0-rc2/include/linux/stddef.h:12:2: error: expected identifier
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:21:25: error: typedef redefinition with different types ('__kernel_dev_t' (aka 'unsigned int') vs '__dev_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:25:15: error: typedef redefinition with different types ('u32' (aka 'unsigned int') vs '__nlink_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:35:9: error: unknown type name '_Bool'
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:35:17: error: redeclaration of C++ built-in type 'bool'
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:113:15: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:115:15: error: typedef redefinition with different types ('s64' (aka 'long long') vs '__int64_t' (aka 'long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:135:13: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__blkcnt_t' (aka 'long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/cache.h:6:10: fatal error: 'asm/cache.h' file not found
Skipping '/home/voltagex/src/systemd/src/systemd/sd-device.h' due to one or more errors listed above.
Diagnostics for '/home/voltagex/src/systemd/src/systemd/sd-device.h':
/usr/include/x86_64-linux-gnu/asm/stat.h:83:8: error: redefinition of 'stat'
/usr/include/x86_64-linux-gnu/asm/stat.h:132:16: error: expected ';' at end of declaration list
/usr/include/x86_64-linux-gnu/asm/stat.h:133:16: error: expected ';' at end of declaration list
/usr/include/x86_64-linux-gnu/asm/stat.h:134:16: error: expected ';' at end of declaration list
/usr/src/linux-headers-6.10.0-rc2/include/linux/stddef.h:11:2: error: expected identifier
/usr/src/linux-headers-6.10.0-rc2/include/linux/stddef.h:12:2: error: expected identifier
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:21:25: error: typedef redefinition with different types ('__kernel_dev_t' (aka 'unsigned int') vs '__dev_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:25:15: error: typedef redefinition with different types ('u32' (aka 'unsigned int') vs '__nlink_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:35:9: error: unknown type name '_Bool'
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:35:17: error: redeclaration of C++ built-in type 'bool'
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:113:15: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__uint64_t' (aka 'unsigned long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:115:15: error: typedef redefinition with different types ('s64' (aka 'long long') vs '__int64_t' (aka 'long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/types.h:135:13: error: typedef redefinition with different types ('u64' (aka 'unsigned long long') vs '__blkcnt_t' (aka 'long'))
/usr/src/linux-headers-6.10.0-rc2/include/linux/cache.h:6:10: fatal error: 'asm/cache.h' file not found
Skipping '/home/voltagex/src/systemd/src/systemd/sd-device.h' due to one or more errors listed above.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
Well it was worth a shot, but I am beginning to think slogging through LibraryImport would be easier.
$ ClangSharpPInvokeGenerator --include-directory /usr/src/linux-headers-6.10.0-rc2/include/linux/ --include-directory /usr/src/linux-headers-6.10.0-rc2/include/ -f ~/src/systemd/src/systemd/sd-device.h --namespace SdDevice --output $(pwd)/
test.cs
$ ClangSharpPInvokeGenerator --include-directory /usr/src/linux-headers-6.10.0-rc2/include/linux/ --include-directory /usr/src/linux-headers-6.10.0-rc2/include/ -f ~/src/systemd/src/systemd/sd-device.h --namespace SdDevice --output $(pwd)/
test.cs
message continues, there is no way in hell I am subscribing to Discord Nitro to be able to communicate.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
ah, that's meant to be a filename, not a directory
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
(it's not in docker now, but I am getting the error no matter where I run ClangSharpPInvokeGenerator)
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
Unhandled exception: System.UnauthorizedAccessException: Access to the path '/home/voltagex/src/docker/test-pinvoke' is denied.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
this maybe should be a bit clearer in the instructions on the repo @Tanner Gooding
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
46MB, that seems more like it
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
thanks @reflectronic
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
right!
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
yes, but I need libclang/libClangSharp which are nupkg files. I can't see past the meta-package at a glance.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
WIthout setting up a csproj somewhere I can't see how to pull down the correct package
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
bah, we're way off topic now and I'm missing simple stuff.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
but I am not sure what it's asking me to read on https://github.com/dotnet/clangsharp
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
*****IMPORTANT*****
Failed to resolve libClang.
If you are running as a dotnet tool, you may need to manually copy the appropriate DLLs from NuGet due to limitations in the dotnet tool support. Please see https://github.com/dotnet/clangsharp for more details.
*****IMPORTANT*****

Unhandled exception: System.DllNotFoundException: Unable to load shared library 'libclang' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/home/voltagex/.dotnet/tools/.store/clangsharppinvokegenerator/18.1.0/clangsharppinvokegenerator/18.1.0/tools/net8.0/any/libclang.so: cannot open shared object file: No such file or directory
/
*****IMPORTANT*****
Failed to resolve libClang.
If you are running as a dotnet tool, you may need to manually copy the appropriate DLLs from NuGet due to limitations in the dotnet tool support. Please see https://github.com/dotnet/clangsharp for more details.
*****IMPORTANT*****

Unhandled exception: System.DllNotFoundException: Unable to load shared library 'libclang' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/home/voltagex/.dotnet/tools/.store/clangsharppinvokegenerator/18.1.0/clangsharppinvokegenerator/18.1.0/tools/net8.0/any/libclang.so: cannot open shared object file: No such file or directory
/
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
yep, that was throwing errors about not neing able to find various .so files
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
@Zombie I wasn't able to work out how to tell dotnet/nuget to give me the file while not in a csproj, I also couldn't find the native binaries in whatever clangsharp nupkg. I am most definitely missing something here.
85 replies
CC#
Created by voltagex on 6/24/2024 in #help
LibraryImport examples, especially on Linux
I did not expect to be compiling Clang today.
85 replies