Can't find unit Test.dll used by XXX lazarus / 67-Windows ---------------------------------------------------------------------- ortodox · 2018-05-08 17:49 Hi. I try to compile object pascal sources and i get error "Can't find unit Test.dll used by XXX" I compile object pascal sources in command line uses free pascal compiler like this": fpc XXX -dCLR -MOBJFPC -Fu"PATH\References\". DLL library is in "References" directory above and dll library is in sources under "uses" statement like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses {$IFNDEF CLR}  aaa, bbb, ccc,{$ELSE}  Test  Whats wrong? ---------------------------------------------------------------------- marcov · 2018-05-08 17:53 You do realize that there are two kinds of DLL. Clr DLL and real DLL? FPC only interfaces to real DLLs, and not .NET assemblies, aka .NET/CLR DLLs ? ---------------------------------------------------------------------- ortodox · 2018-05-08 18:27 Two kinds of DLL? I have never heard of it. Do you have some materials to it? I found https://cs.wikipedia.org/wiki/DLL but this is .net DLL. ---------------------------------------------------------------------- marcov · 2018-05-08 18:49 Quote from: ortodox on May 08, 2018, 08:27:48 pmTwo kinds of DLL? I have never heard of it. Do you have some materials to it? I found https://cs.wikipedia.org/wiki/DLL but this is .net DLL. The english version of that: vs https://en.wikipedia.org/wiki/Dynamic-link_library#Delphi (note the Delphi paragraph, that is similar to FPC) the .NET implementation: https://en.wikipedia.org/wiki/Assembly_(CLI) which is something totally different. This will need to be approached over COM interop in FPC ---------------------------------------------------------------------- ortodox · 2018-05-08 19:59 QuoteThis will need to be approached over COM interop in FPC Can I this resolved? If I undestand right? With COM interop....Do you have some documentation of this please? I found nothing. Or it could be possible convert .net dll to normal .dll? I understand right that normal .dll is win32/com .dll library? Thank you. ---------------------------------------------------------------------- Thaddy · 2018-05-09 05:11 fpc XXX -dCLR -MOBJFPC -Fu"PATH\References\". ??? Options first, please: fpc -dCLR -MOBJFPC -Fu"PATH\References\" XXX Also note CLR seems to be defined somewhere in your code. It looks like it shouldn't. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$if defined(CLR)}{$UNDEF CLR}{$ifend} Before the other defines..will use aaa,bbb,ccc instead of test. Better look up where CLR is defined...and comment it out. But this will also work. ---------------------------------------------------------------------- marcov · 2018-05-09 06:10 Quote from: ortodox on May 08, 2018, 09:59:40 pmQuoteThis will need to be approached over COM interop in FPC Can I this resolved? I don't know if it is always possible (if there are .NET assemblies that can't be interfaced from Delphi/FPC easily). QuoteIf I undestand right? With COM interop....Do you have some documentation of this please? I found nothing. Strange. When I put "com interop" in google, I get pages of stuff. It is the way all .NET code interfaces with native win32 or win64 code. Delphi and FPC just have some ways of make that easier (like the ability to define COM compatible interfaces) Documentation is Microsoft for the general .NET->native case, and look for Delphi and COM for some more specific info. I just needed to know enough to avoid .NET only software products, never done it myself. QuoteOr it could be possible convert .net dll to normal .dll? Not that I know. At best you can generate some DLL that talks to .NET which then (should) loads the .NET assembly DLL internally QuoteI understand right that normal .dll is win32/com .dll library? Normal dll is win32. Some dlls might also contain COM.  .NET is COM based internally, but piles extra layers on top. As said the subject to look for is .NET<->COM interop to get the fundamental concepts, and then general Delphi (and thus FPC/Lazarus) ways to connect to COM.  I never done it myself, so can only give you general pointers like https://stackoverflow.com/questions/16785357/how-to-call-net-from- delphi  (found with Delphi call .net)