|
|
Home » Community » Coffee corner » Strange Architecture (Dll Hot load)
|
Re: Strange Architecture [message #52089 is a reply to message #52077] |
Wed, 17 July 2019 20:14   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Xemuth wrote on Tue, 16 July 2019 06:34
Is it possible to compile modules as Dll (or linux equivalent)
and Programme SmartUppBot to allowing it to "hot load" dll located on a file and use it ?
if yes. Do this system have a limit ? is it a good way to do "clean" programme ?
The U++'s way of working with DLLs is this.
It looks like DLLs name should be known at compile time, but you should be able to improve this code if you want to.
In general, DLLs are loaded/unloaded via dlopen/dlclose calls (in Windows these functions have different names).
Useful tool: Dependency Walker.
Besides showing you what is imported/exported it allows you to trace DLL-related calls.
Try to trace any app and you'll have a lot of fun.
You can create DLLs in U++.
U++ itself is not very well suited to be shared among DLLs.
Hint: try to choose "All shared" in "Output mode" and check what will happen.
Hope this helps.
Regards,
Novo
|
|
|
|
Re: Strange Architecture [message #52097 is a reply to message #52095] |
Thu, 18 July 2019 16:57   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Xemuth wrote on Thu, 18 July 2019 08:45
That's mean I can do near the same code between linux and windows ? or dll in windows and linux don't have same architecture ?
Linux and Windows have similar architectures.
DLL-related functions have different names, but they do pretty much the same thing.
You just need to write a platform-independed wrapper for them.
This is a trivial task.
DLLs on Windows and Linux behave slightly differently.
Main source of information for you should be man ld.so
Read it carefully.
Other useful apps on Linux: ldd, nm.
Start with man ldd and man nm
Hope this helps.
Regards,
Novo
[Updated on: Fri, 19 July 2019 04:32] Report message to a moderator
|
|
|
|
Re: Strange Architecture [message #52104 is a reply to message #52099] |
Fri, 19 July 2019 17:38   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Xemuth wrote on Fri, 19 July 2019 06:29
I probably used it wrong. Can you explain me what's for ?
It is supposed to compile each U++ package as DLL. This works in Linux. It looks like this doesn't work in Windows.
If you can compile a package as DLL, you can link against this DLL and do not need to include all U++ into you own DLL.
This feature is not supported by U++ very well. This is one of limitations.
Regards,
Novo
|
|
|
|
Re: Strange Architecture [message #55943 is a reply to message #52099] |
Tue, 05 January 2021 16:59   |
JeyCi
Messages: 67 Registered: July 2020
|
Member |
|
|
Xemuth wrote on Fri, 19 July 2019 12:29and just got error :
Creating library...
lld: error: unknown argument: -u
collect2.exe: error: ld returned 1 exit status
There were errors. (0:00.34)
I probably used it wrong. Can you explain me what's for ?
today I've got the same error, then just changed gcc compiler for MINGW v.9.3 (from msys) - & dll compiled OK (for Windows was compiled)... though I haven't load it yet in main() to use it...
but I agree with Mirek
mirek wrote on Thu, 12 February 2015 15:30 With .dll you have to sacrifice performance and do many things in more complicated way...
Best regards.
[Updated on: Tue, 05 January 2021 17:20] Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 14:23:37 CEST 2025
Total time taken to generate the page: 0.00932 seconds
|
|
|