Closed NrSlionHeart closed 1 year ago
Do I miss some steps here or something?
No, the steps described above are sufficient. As a quick sanity check, can you try using the sample in the repo? See sample/
.
I am a C++ programmer and the whole setting up for this C# project is kinda confusing to me - I had the impression that adding the nuget package should be enough.
Yes, that is the case. The details you've mentioned are what is required if someone decides to use the dnne-gen
tool directly. However, if the DNNE package is used directly all appropriate flags and settings are passed to the compiler.
I downloaded the sample and I could compile it.
I checked if it exports the functions correctly using dependency walker and they seem fine .. like the functions are in there, a lot of missing dependencies, but I assume that can be corrected with the needed files.
I think that this solves my problem for the moment, however does not solve the general problem that it does not compile against a new basically empty project... I assume it is something about the project settings
Thank you anyway!!!
And I found what the issue is - when I try to compile a build specifically for x86 I get that error ... any idea how to fix this ?
@NrSlionHeart You should have the x86 version of the runtime installed and specify the RID. See step (3) in readme.md - https://github.com/AaronRobinsonMSFT/DNNE#generating-a-native-binary-using-the-dnne-nupkg.
About the above - I've got it all working - check that everything is set to x86 - so runtime target but also the platform etc - if it mismatches somewhere it won't compile - also, something I noticed which helps - close Visual Studio - remove the obj
and bin
folders and re-open the project
Class Library for Clarion.zip I've created a template for it - maybe it's useful to you - you'll have to import it into Visual Studio and then when the project is created, create your .cs file which will contain your exports - add DNNE - and it should function
Thanks @ThaDaVos. Very much appreciate the shared template.
Steps:
Do I miss some steps here or something?
Because the documentation says: "The DNNE_ASSEMBLY_NAME must be set during compilation to indicate the name of the managed assembly to load. The assembly name should not include the extension. For example, if the managed assembly on disk is called ClassLib.dll, the expected assembly name is ClassLib."
and
"The generated source will need to be linked against the nethost library as either a static lib (libnethost.[lib|a]) or dynamic/shared library (nethost.lib). If the latter linking is performed, the nethost.[dll|so|dylib] will need to be deployed with the export binary or be on the path at run time."
I am a C++ programmer and the whole setting up for this C# project is kinda confusing to me - I had the impression that adding the nuget package should be enough.
Can someone please write a better document with the steps to add DNNE to a project? Like how to actually set DNNE_ASSEMBLY_NAME if that is needed and so on ...