ddobrev / QtSharp

Mono/.NET bindings for Qt
Other
571 stars 52 forks source link

System.EntryPointNotFoundException #73

Closed viennem closed 6 years ago

viennem commented 6 years ago

I am trying to build QtSharp from source in Linux, and after building QtSharp and QtSharp.CLI, I get a System.EntryPointNotFoundException when I execute QtSharp.CLI.exe.

Here is the stack trace :

./QtSharp.CLI.exe /usr/bin/qmake /usr/bin/make

Unhandled Exception:
System.EntryPointNotFoundException: _ZNSsC2EPKcRKSaIcE
at (wrapper managed-to-native) Std.BasicStringExtensions+__Internal:BasicString (intptr,string,intptr)
at Std.BasicStringExtensions.BasicString (System.String __s, Std.Allocator`1[_Tp] __a) [0x00043] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.CppParserOptions.set_CurrentDir (System.String value) [0x00007] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.ParserOptions..ctor () [0x00037] in <d0ea571a50de466e87ea59625d3ad8d8>:0 
at CppSharp.Driver..ctor (CppSharp.DriverOptions options) [0x0000e] in <ee554a8a50744b808e95927caba493c0>:0 
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary library) [0x00012] in <ee554a8a50744b808e95927caba493c0>:0 
at QtSharp.CLI.Program.Main (System.String[] args) [0x00132] in <56bd7b068a7c4474a95c84cb25e4df1d>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.EntryPointNotFoundException: _ZNSsC2EPKcRKSaIcE
at (wrapper managed-to-native) Std.BasicStringExtensions+__Internal:BasicString (intptr,string,intptr)
at Std.BasicStringExtensions.BasicString (System.String __s, Std.Allocator`1[_Tp] __a) [0x00043] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.CppParserOptions.set_CurrentDir (System.String value) [0x00007] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.ParserOptions..ctor () [0x00037] in <d0ea571a50de466e87ea59625d3ad8d8>:0 
at CppSharp.Driver..ctor (CppSharp.DriverOptions options) [0x0000e] in <ee554a8a50744b808e95927caba493c0>:0 
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary library) [0x00012] in <ee554a8a50744b808e95927caba493c0>:0 
at QtSharp.CLI.Program.Main (System.String[] args) [0x00132] in <56bd7b068a7c4474a95c84cb25e4df1d>:0 

I think this may have something to do with how I built Std-symbols, as I was getting this error before :

Unhandled Exception:
System.DllNotFoundException: Std-symbols
at (wrapper managed-to-native) Std.Allocator.__Internal:ctorc__N_std_S_allocator__C (intptr)
at Std.Allocator`1[_Tp]..ctor () [0x00062] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.CppParserOptions.set_CurrentDir (System.String value) [0x00001] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.ParserOptions..ctor () [0x00037] in <d0ea571a50de466e87ea59625d3ad8d8>:0 
at CppSharp.Driver..ctor (CppSharp.DriverOptions options) [0x0000e] in <ee554a8a50744b808e95927caba493c0>:0 
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary library) [0x00012] in <ee554a8a50744b808e95927caba493c0>:0 
at QtSharp.CLI.Program.Main (System.String[] args) [0x00132] in <4ee717a94dfb4893989577eea8c6d838>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: Std-symbols
at (wrapper managed-to-native) Std.Allocator.__Internal:ctorc__N_std_S_allocator__C (intptr)
at Std.Allocator`1[_Tp]..ctor () [0x00062] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.CppParserOptions.set_CurrentDir (System.String value) [0x00001] in <b4366ecae22442a6a92f9aebbdb88ac5>:0 
at CppSharp.Parser.ParserOptions..ctor () [0x00037] in <d0ea571a50de466e87ea59625d3ad8d8>:0 
at CppSharp.Driver..ctor (CppSharp.DriverOptions options) [0x0000e] in <ee554a8a50744b808e95927caba493c0>:0 
at CppSharp.ConsoleDriver.Run (CppSharp.ILibrary library) [0x00012] in <ee554a8a50744b808e95927caba493c0>:0 
at QtSharp.CLI.Program.Main (System.String[] args) [0x00132] in <4ee717a94dfb4893989577eea8c6d838>:0

I built Std-symbols this way:

cd CppSharp/src/CppParser/Bindings/CSharp/x86_64-linux-gnu-cxx11abi/
gcc -c -Wall -Werror -fpic Std-symbols.cpp
gcc -shared -o libStd-symbols.so Std-symbols.o
cp ./libStd-symbols.so QtSharp/QtSharp.CLI/bin/Debug/
tritao commented 6 years ago

Can you run nm on the Std-symbols lib?

tritao commented 6 years ago

I was thinking that we already should be compiling this library as part of the CppSharp compilation process, you should not need to compile it yourself to run Qt#.

https://github.com/mono/CppSharp/blob/0805ab1798da5fd83ed43241082519e382000d34/src/CppParser/premake5.lua#L41

ddobrev commented 6 years ago

@tritao he works on Linux, not Windows.

tritao commented 6 years ago

I'm aware, and it should make no difference.

ddobrev commented 6 years ago

@tritao he's talking about Std-symbols for C++# rather than Qt#. The copy for Qt# is indeed auto-compiled. That is, his present issue is that he cannot generate Qt#, not that he cannot run it.

tritao commented 6 years ago

Again... I'm aware. It should already be compiled.

ddobrev commented 6 years ago

@viennem actually, @tritao has a point: you've run our tests successfully which means you should already have a copy of libStd-symbols.so. Just move it next to your executable.

viennem commented 6 years ago

That's it, thanks again!