Closed ljzj2 closed 5 months ago
I want to use .net to create library then release it as Static lib(.lib). and another c++ program can use it. I use this: > dotnet publish /p:NativeLib=Static --use-current-runtime int this page https://github.com/dotnet/samples/blob/main/core/nativeaot/NativeLibrary/README.md but it seems not work.
> dotnet publish /p:NativeLib=Static --use-current-runtime
there is one method:
[UnmanagedCallersOnly(EntryPoint = "get")] public static IntPtr Get(IntPtr url) { return IntPtr.Zero }
yes it will create mylib.lib but nothing in it.
If I use it in c++ program there will be unresolved symbols which means there is no this method in the lib right?
I have used this in c++ #pragma comment(lib,"mylib.lib");
#pragma comment(lib,"mylib.lib");
I want to use .net to create library then release it as Static lib(.lib). and another c++ program can use it. I use this:
> dotnet publish /p:NativeLib=Static --use-current-runtime
int this page https://github.com/dotnet/samples/blob/main/core/nativeaot/NativeLibrary/README.md but it seems not work.there is one method:
yes it will create mylib.lib but nothing in it.
If I use it in c++ program there will be unresolved symbols which means there is no this method in the lib right?
I have used this in c++
#pragma comment(lib,"mylib.lib");