You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I build the C# ObjectArx library using NativeAOT for Cad programs like C++, but the library needs two export APIs "ACRXEntryPoint" and "acrxGetApiVersion".
rxapi.lib(libinit.obj) : warning LNK4099: PDB '' was not found with 'rxapi.lib(libinit.obj)' or at ''; linking object as if no debug info [N:\My_Projects\asdkmgPoly\asdkmgPoly\asdkmgPoly.csproj]
msvcprt.lib(nothrow.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in Runtime.WorkstationGC.lib(thread.cpp.obj) [N:\My_Projects\asdkmg
Poly\asdkmgPoly\asdkmgPoly.csproj]
The error is caused by ObjectArx library built as "dynamic link" that leads to the mismatch.
Are you able to rebuild the ObjectArx library as "static link"? If you are using Visual Studio, set Properties / C/C++ / CodeGeneration / RuntimeLibrary to "Multi-threaded (/MT)" in your project file properties.
Activity
jkotas commentedon Apr 28, 2023
The pre-built .NET runtime libraries that are included in native AOT package are built as "static link" (https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170#c-standard-library-stl-lib-files).
The error is caused by ObjectArx library built as "dynamic link" that leads to the mismatch.
Are you able to rebuild the ObjectArx library as "static link"? If you are using Visual Studio, set Properties / C/C++ / CodeGeneration / RuntimeLibrary to "Multi-threaded (/MT)" in your project file properties.
AhmedZero commentedon Apr 28, 2023
there is no source code for ObjectArx.
jkotas commentedon Apr 28, 2023
We do not have a great solution for this today. The potential workarounds that I can think of are:
runtime/eng/native/configurecompiler.cmake
Line 770 in 5eeb91f
#83611 tracks adding an option for compiling the unmanaged runtime with custom C++ compiler options that would help here.
AhmedZero commentedon Apr 28, 2023
there is no DLL for
rxapi.That solution is only available.
I hope we get a great solution in the future.
jkotas commentedon Apr 28, 2023
You can build it yourself.
+1. Resolving as duplicate of #83611
AhmedZero commentedon Apr 28, 2023
I hope can build rxapi but there is no source code for rxapi. it's just headers and static library.
jkotas commentedon Apr 28, 2023
You can build it from the static library:
acrxGetApiVersionImpl)AhmedZero commentedon Apr 28, 2023
I understand, thanks.