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
{{ message }}
Repository navigation
Doesn't run on linux (Kubuntu 18.10), but compiles without any issues #83
changed the title [-]Doesn't run on linux (Kubuntu 18.10), but compiles without an issue[/-][+]Doesn't run on linux (Kubuntu 18.10), but compiles without any issues[/+]on Jan 7, 2019
I think so. dlopen just returns IntPtr.Zero. Are you able to compile ReClass.NET? You could add a dlerror call to see if the error message tells something usefull.
Yes, as I stated in the title, I am able to compile.
The code you have provided does not compile due to the fact that IntPtr doesn't contain the IsNull definition.
error CS1061: 'IntPtr' does not contain a definition for 'IsNull' and no extension method 'IsNull' accepting a first argument of type 'IntPtr' could be found
Edit: I have fixed the code and the exception returned the following message: Unhandled Exception: System.Exception: dlopen exception: /home/shiruba/ReClass.NET/ReClass.NET/bin/Debug/x64/NativeCore.so: undefined symbol: _ZNKSt25__codecvt_utf8_utf16_baseIDsE6do_outER11__mbstate_tPKDsS4_RS4_PcS6_RS6_
So now it is clear why the library can't be loaded. But why does this message occur? Shouldn't the linker detect this error at compile time? @stevemk14ebr: Do you have an idea?
I never got past failing to open NativeCore.so it's always not found for me, so yea it's related to #47 . I'm also on Ubuntu 17.10 though which is not officially supported by mono it seems, im running the packages for 16.04 which yea is probably not good so don't rely on me.
Unhandled Exception:
System.IO.FileNotFoundException: Failed to load native core functions! Couldnt find at location /home/steve/Desktop/ReClass.NET/ReClass.NET/bin/Debug/x86/NativeCore.so
at ReClassNET.Core.InternalCoreFunctions.Create () [0x0003e] in :0
at ReClassNET.Core.CoreFunctionsManager..ctor () [0x00013] in :0
at ReClassNET.Program.Main (System.String[] args) [0x00097] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Failed to load native core functions! Couldnt find at location /home/steve/Desktop/ReClass.NET/ReClass.NET/bin/Debug/x86/NativeCore.so
at ReClassNET.Core.InternalCoreFunctions.Create () [0x0003e] in :0
at ReClassNET.Core.CoreFunctionsManager..ctor () [0x00013] in :0
at ReClassNET.Program.Main (System.String[] args) [0x00097] in :0
@stevemk14ebr can you replace the LoadLibrary function in NativeMethods.Unix.cs with the one I posted above to see if the error is the same on different ubuntu versions?
Unhandled Exception:
System.Exception: dlopen exception: /home/steve/Desktop/ReClass.NET/ReClass.NET/bin/Debug/x86/NativeCore.so: undefined symbol: ZNKSt25__codecvt_utf8_utf16_baseIDsE6do_outER11__mbstate_tPKDsS4_RS4_PcS6_RS6
at ReClassNET.Native.NativeMethodsUnix.LoadLibrary (System.String fileName) [0x00035] in :0
at ReClassNET.Native.NativeMethods.LoadLibrary (System.String name) [0x00001] in :0
at ReClassNET.Core.InternalCoreFunctions.Create () [0x00021] in :0
at ReClassNET.Core.CoreFunctionsManager..ctor () [0x00013] in :0
at ReClassNET.Program.Main (System.String[] args) [0x00097] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: dlopen exception: /home/steve/Desktop/ReClass.NET/ReClass.NET/bin/Debug/x86/NativeCore.so: undefined symbol: ZNKSt25__codecvt_utf8_utf16_baseIDsE6do_outER11__mbstate_tPKDsS4_RS4_PcS6_RS6
at ReClassNET.Native.NativeMethodsUnix.LoadLibrary (System.String fileName) [0x00035] in :0
at ReClassNET.Native.NativeMethods.LoadLibrary (System.String name) [0x00001] in :0
at ReClassNET.Core.InternalCoreFunctions.Create () [0x00021] in :0
at ReClassNET.Core.CoreFunctionsManager..ctor () [0x00013] in :0
at ReClassNET.Program.Main (System.String[] args) [0x00097] in :0
the offending symbol is: std::__codecvt_utf8_utf16_base<char16_t>::do_out(__mbstate_t&, char16_t const*, char16_t const*, char16_t const*&, char*, char*, char*&) const
but there's alot of undefined symbols, something is wrong in linking i think:
nm NativeCore.so | grep ZNKSt25__codecvt_utf8_utf16_baseIDsE6do_outER11__mbstate_tPKDsS4_RS4_PcS6_RS6 -B 3 -A 3
nm --demangle NativeCore.so | grep 22518 -B 3 -A 3
Activity
[-]Doesn't run on linux (Kubuntu 18.10), but compiles without an issue[/-][+]Doesn't run on linux (Kubuntu 18.10), but compiles without any issues[/+]KN4CK3R commentedon Jan 7, 2019
That's the same problem I had in #47 or? If so, I haven't figured out what the problem was/is. Maybe dlopen can't load a dependency?
FilipeSilvens commentedon Jan 7, 2019
Does it successfully import libdl.so?
ReClass.NET/ReClass.NET/Native/NativeMethods.Unix.cs
Lines 13 to 14 in a41ad33
KN4CK3R commentedon Jan 7, 2019
I think so. dlopen just returns IntPtr.Zero. Are you able to compile ReClass.NET? You could add a dlerror call to see if the error message tells something usefull.
The new code could look like this:
With the equivalent for Windows and GetLastError (or better use DllImportAttribute.SetLastError). After that
ReClass.NET/ReClass.NET/Core/InternalCoreFunctions.cs
Lines 52 to 56 in b22d79b
and
ReClass.NET/ReClass.NET/Plugins/PluginManager.cs
Lines 136 to 140 in b22d79b
should be changed to use the exception.
FilipeSilvens commentedon Jan 7, 2019
Yes, as I stated in the title, I am able to compile.
The code you have provided does not compile due to the fact that IntPtr doesn't contain the IsNull definition.
error CS1061: 'IntPtr' does not contain a definition for 'IsNull' and no extension method 'IsNull' accepting a first argument of type 'IntPtr' could be foundEdit: I have fixed the code and the exception returned the following message:
Unhandled Exception: System.Exception: dlopen exception: /home/shiruba/ReClass.NET/ReClass.NET/bin/Debug/x64/NativeCore.so: undefined symbol: _ZNKSt25__codecvt_utf8_utf16_baseIDsE6do_outER11__mbstate_tPKDsS4_RS4_PcS6_RS6_KN4CK3R commentedon Jan 7, 2019
Here is
IsNull():ReClass.NET/ReClass.NET/Extensions/IntPtrExtensions.cs
Lines 9 to 14 in 805d618
So now it is clear why the library can't be loaded. But why does this message occur? Shouldn't the linker detect this error at compile time?
@stevemk14ebr: Do you have an idea?
FilipeSilvens commentedon Jan 7, 2019
Running the program with "sudo MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" mono ReClass.NET.exe" printed some more interesting information:
https://gist.github.com/FilipeSilvens/f373e89453ecc084cf65af08e15d29ae
KN4CK3R commentedon Jan 7, 2019
The logged exception is just the exception you have created or not?
FilipeSilvens commentedon Jan 7, 2019
It is. I replaced the LoadLibrary code with this:
and imported dlerror, of course.
stevemk14ebr commentedon Jan 7, 2019
I never got past failing to open NativeCore.so it's always not found for me, so yea it's related to #47 . I'm also on Ubuntu 17.10 though which is not officially supported by mono it seems, im running the packages for 16.04 which yea is probably not good so don't rely on me.
FilipeSilvens commentedon Jan 7, 2019
@stevemk14ebr can you replace the LoadLibrary function in NativeMethods.Unix.cs with the one I posted above to see if the error is the same on different ubuntu versions?
Also don't forget to import dlerror above
stevemk14ebr commentedon Jan 7, 2019
yup it is:
stevemk14ebr commentedon Jan 7, 2019
the offending symbol is: std::__codecvt_utf8_utf16_base<char16_t>::do_out(__mbstate_t&, char16_t const*, char16_t const*, char16_t const*&, char*, char*, char*&) const
but there's alot of undefined symbols, something is wrong in linking i think:
stevemk14ebr commentedon Jan 8, 2019
#84 will catch these at link time, still don't know why there's so many undefined though.
FilipeSilvens commentedon Jan 8, 2019
I have managed to fix the undefined symbols, but now I get an out of range exception when I start the program.
https://gist.github.com/FilipeSilvens/69194e690b5a2def90a34b58e085cfdb
The original issue which is also present in #47 can be fixed by linking
-lstdc++and-ldlin the NativeCore's Makefile.stevemk14ebr commentedon Jan 8, 2019
Fixed in #86 and #85 may be incomplete fix for scroll bar behavior
FilipeSilvens commentedon Jan 8, 2019
Yup, all works good now. Thank you for helping :D
KN4CK3R commentedon Jan 8, 2019
Thank you @stevemk14ebr for your help!
stevemk14ebr commentedon Jan 8, 2019
Welcome 🎉