|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » creating DLLs HOWTO ??
Re: creating DLLs HOWTO ?? [message #23768 is a reply to message #23752] |
Fri, 20 November 2009 11:04  |
 |
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
i could solve the problem with compiling the dll with MSC by using a manual .def file, created from the .map file, which had to be enabled for creation in builder settings of package. so a .lib file could be created during dll recompile, and thus the app could link.
here comes the refined TestDll project, which has a README.txt
hope this will help anyone.
to the upp crew, maybe rethink of generating the def files automatically again?? (in case it was disabled), its just tooo much needed, to export functionality in classes
///the README.txt
the MSC def file is created from the map file, which is to be generated of first compile (enable create map)
content of .map file is something like
....
0001:00009c90 ??0TestDll@@QAE@XZ" target="_blank">>@XZ 1000ac90 f TestDll.obj
0001:00009cc0 ??_GTestDll@@UAEPAXI@Z" target="_blank">>@Z 1000acc0 f i TestDll.obj
0001:00009cc0 ??_ETestDll@@UAEPAXI@Z" target="_blank">>@Z 1000acc0 f i TestDll.obj
0001:00009d00 ??1TestDll@@UAE@XZ" target="_blank">>@XZ 1000ad00 f TestDll.obj
0001:00009d20 ?MyTestFunction@TestDll@@QAEHXZ 1000ad20 f TestDll.obj
0001:00009d40 ??0Nuller@Upp@@QAE@XZ" target="_blank">>@XZ 1000ad40 f i TestDll.obj
....
you can strip off the unnessessary stuff when pasting the text into excel or openoffice and setting as delimiter the space
the content of the .def file is then something like
EXPORTS
??0TestDll@@QAE@XZ" target="_blank">>@XZ
??_GTestDll@@UAEPAXI@Z" target="_blank">>@Z
??_ETestDll@@UAEPAXI@Z" target="_blank">>@Z
??1TestDll@@UAE@XZ" target="_blank">>@XZ
?MyTestFunction@TestDll@@QAEHXZ
??0Nuller@Upp@@QAE@XZ" target="_blank">>@XZ
modify your dll package config
create new link option
WHEN: MSC & DLL /DEF:TestDll.def
/recompile, ensure that it really recompiles, change something in your source files (space add or something)
it will error things:
....
TestDll.def : warning LNK4102: export of deleting destructor 'public: virtual void * __thiscall TestDll::`scalar deleting destructor'(unsigned int)'; i
mage may not run correctly
TestDll.def : warning LNK4102: export of deleting destructor 'public: virtual void * __thiscall TestDll::`vector deleting destructor'(unsigned int)'; i
mage may not run correctly
Creating library C:\upp_1679\out\MSC9.Debug.Debug_full.Dll.Mt.Shared.So\TestD ll.lib and object C:\upp_1679\out\MSC9.Debug.Debug_full.Dll.Mt.Shared.S
o\TestDll.exp
TestDll.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall TestDll::`vector deleting destructor'(unsigned int)" (??_ETe
stDll@@UAEPAXI@Z" target="_blank">>@Z)
TestDll.exp : error LNK2001: unresolved external symbol "public: virtual void * __thiscall TestDll::`vector deleting destructor'(unsigned int)" (??_ETe
stDll@@UAEPAXI@Z" target="_blank">>@Z)
C:\upp_1679\out\MSC9.Debug.Debug_full.Dll.Mt.Shared.So\TestD ll.dll : fatal error LNK1120: 1 unresolved externals
....
remove the virtual destructor things, they may not be there, dont know exactly why
??_GTestDll@@UAEPAXI@Z" target="_blank">>@Z
??_ETestDll@@UAEPAXI@Z" target="_blank">>@Z
recompile again, this should work
in your application, that also has to be compiled with MSC, include only the header of the dll
an add a library dependency in your package organizer (TestDll)
copy the TestDll.dll and .lib into the package folder of the app, it will be able to compile then
copy them also in the output/execution folder, it should be able to start
/////
|
|
|
Goto Forum:
Current Time: Fri Jun 06 20:53:19 CEST 2025
Total time taken to generate the page: 0.04587 seconds
|
|
|