I've read a lot of threads here, but I could not get it working.
I have a freeware-dll (PureBasic?) to convert bmp's to jpg's images. Now I want to make the dll to a static lib. And then use the functions in another (my own) dll.
Can you please help, here is the dll link: Click here.

Posted on 2003-12-12 16:07:18 by Nordwind64
for import library for this and then use the dll.

check the retn code for the 2 procedures

retn 000Ch ; 12, which means 3 DWORD params.

Bmp2 Jpg
retn 000Ch ; 12, which means 3 DWORD params

now put these into an .inc file called bmp2jpg.inc and run inc2l.exe on this .inc file. you'll have your static lib.



for static library u can take this file and use externs.
Posted on 2003-12-12 16:33:30 by evil__donkey
Is there a dll to obj dumper, because if there is then you can easily generate libs and objs. have to give this a search.
Posted on 2003-12-12 16:35:58 by evil__donkey
Thanks, evil_donkey !

I tried your lib with externs, but only get this message:

Bmp2Jpg.lib(Bmp2Jpg.obj) : warning LNK4078: multiple ".idata" section found with different attributes (C0100060)
LINK : fatal error LNK1104: cannot open file "LIBC.lib"

What's the error ?

Posted on 2003-12-12 17:16:25 by Nordwind64
hi im trying to figure out what went wrong. i havent tested it here but it was a quick dump from dll2lib. i'll let you know what i get
Posted on 2003-12-12 17:48:15 by evil__donkey
heres a quick pic of the stuff inside the .lib file. it seems to be ok. do you have msvc installed on your computer. libc.lib is a part of msvc.
Posted on 2003-12-12 18:02:41 by evil__donkey

shit, could not get it work...
No, I've not msvc installed. I could not find libc.lib on my computer.
Seems, I need a little example to get it workin'...

Posted on 2003-12-13 04:49:00 by Nordwind64
heres another try it. the file has extension .zip, with cab lzx compression so it may not open on your comp so rename it to dll.exe and run it.
Posted on 2003-12-13 06:26:16 by evil__donkey
Hi Nordwind64,

FYI, the libc.lib library is included in the Win2K DDK if you ever need it. There is a utility call Dll2Lib by BinarySoft that will convert a DLL to a static library, it is comercial software. I tried it once but had quite a few problems and never took the time to figure it out. Simple Dll's seemed to convert very well, but in the end I decided that the amount of times I would use it did not justify the price. It would be an interesting project to try to write one though.

Posted on 2003-12-13 08:06:59 by donkey
i've included libc.lib in the zip above. if you want the newer version which is larger than 1MB, then you can get the win2k ddk.
Posted on 2003-12-13 08:33:18 by evil__donkey
I was not looking for this.... totally stumbled on it to tell the truth:

HOWTO: Create 32-bit Import Libraries Without .OBJs or Source (**from a dll)
Posted on 2003-12-13 12:10:15 by ThoughtCriminal

evil__donkey: Sorry, don't work for me. I only get the error...

donkey: Thanks, I will try it out !

ThoughtCriminal: Sorry, cannot program C++ very well...

Posted on 2003-12-13 16:46:34 by Nordwind64
I can't either. But maybe those who can here might be able to adapt the technique to assembly users.
Posted on 2003-12-13 21:21:12 by ThoughtCriminal

yes, please !!!
Posted on 2003-12-14 07:02:08 by Nordwind64
mmm, if i am not wrong, why not use nagoa???, nguga have a nice app that do (if I undertand ok) what you say.......

I think you can send a pm for talk to nguga..

Nice day or night.
Posted on 2003-12-15 12:28:56 by rea
Ngb, thank you !

But 6,7 MB... I'm modem user... Can someone please test it, who's working with nagoa ?

Posted on 2003-12-16 13:32:40 by Nordwind64
in win I work with. But ask directly to nguga, see in the page:

4 - Nagoa tutorial NEW !!! 8 - jun - 2002
and watch at this text: Project -> add dll to NAGOA

by the way who is ngb??? no gore blue?? :D

also I am a modem user ;).
Posted on 2003-12-16 23:31:33 by rea

do you have the documentation about the two functions from the bmp2jpeg.dll?

Thanks in advance.


Posted on 2003-12-28 06:15:50 by Gismo
OK. This is my attempt to make a dll to lib converter. My testings are on kernel32.dll. There are two ways.

One is to make a def file and run lib.exe ("c:\masm32\bin\Lib /DEF:%s /MACHINE:IX86 /SUBSYSTEM:Windows"). This generates a lib file but do not work.

The other way is to generate an include file. Trying to generate a lib file with INC2L.exe doesn't work. The kernel32.inc file is moved to \masm32\include folder and the INCL2L.exe is run by running the bat file (echo off inc2l kernel32.inc). No lib file is created.

I have also tryed to run ML.exe. Not working. The code is attached.

Any suggestions?

Best regards
Posted on 2004-01-11 15:23:04 by minor28
Hrm, some people seem to be confusing dll->static lib conversion with generating import lib for a dll...

Doing the conversion is somewhat tricky - that the commercial dll2lib fails on a *lot* f DLLs (even with crashes from dll2lib) shows.

It can be done though, but there's a LOT of complications, especially if the DLL contains resources or other stuff.
Posted on 2004-01-11 17:29:02 by f0dder