News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Question about lib import library and dynamic library

Started by BlackVortex, March 08, 2010, 09:00:51 AM

Previous topic - Next topic

BlackVortex

I'm using an opensource library, which comes with a lib file and a dll file. The lib file doesn't seem to contain code, only the imports themselves, so I guess it's an "import library"
Goasm doesn't even need/use the lib file, it invokes like this : invoke dllname:function

My question is : can I merge the library's code in my own, so I don't have to have the whole dll in the same folder ? Some kind of static linking ?
Maybe some polib magic ?

This isn't a goasm specific question, that's why I'm posting here.

hutch--


If the lib file just contains the DLL exports it will be no use to you. All you need to do is get the export list from ther DLL and you will know what to call from the DLL. You will need the argument types and count but there should be some data that comes with the DLL and LIB.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

BlackVortex

I'm calling it just fine, it also has documentation, my question was whether I could statically link against that dll, so its code is contained in mine.

I want to have one released executable.

redskull

I've never heard of any linker switch that does that, but if it's open source, you can always recompile it as a static library and do it the 'normal' way.  Depending on how much initialization it does (globals, settings, etc), you might have to do some major surgery, though.  At the very least, reimplement the DLL main as part of your init. code.

-r
Strange women, lying in ponds, distributing swords, is no basis for a system of government

dedndave

seems like there ought to be a way to treat it as a resource file
i am too much of a n00b at this stuff - lol
i bet Erol knows a way, though
of course, disassembly is another way to go - but that seems like cheating

joemc

You could put the whole dll in the .data section.  write it to a temporary directory, load it, and delete it when done :)

BlackVortex

 :bg  :toothy :bg

That looks like funny business, guys, dropping off dll in temp folder, hehe.

Since I have the source, can I make a static lib with it ? It's c++   :(


Vortex


BlackVortex

That is awesome  :dazzled:

First I will finalize my project and then I will try your library, so that no weird bugs creep in.

Does the DllEntry of the attached-dll get executed ?

dedndave

i knew Erol had the stuff   :bg
at least i got that part right

Vortex

Hi BlackVortex,

The DllEntry point is not executed. You have to do it programmatically.