digitalmars.D.learn - Making a .lib in D
- Triften Chmil (13/13) Sep 13 2005 I'm trying to compile a .d and make a .lib but the .lib seems to be miss...
- Jarrett Billingsley (8/13) Sep 13 2005 I really wish there were. What you'll have to do instead is have two
- Carlos Santander (5/21) Sep 13 2005 You need to import the .dll in a .lib using 'lib', not creating a D modu...
- Triften Chmil (5/26) Sep 14 2005 I don't see any mention of dll's on the doc page for 'lib'. Where does i...
- Carlos Santander (4/11) Sep 14 2005 My bad, sorry. It's implib, like Jarrett said.
I'm trying to compile a .d and make a .lib but the .lib seems to be missing functions. I verified the behavior by generating a .lst and seeing that some functions from the .d weren't in the .lst. Specifically, I'm trying to compile a .lib for sdl_mixer. I got SDL_mixer.dll from libsdl.org and 'sdl_mixer.d' from D-Porting. I ran 'dmd -c SDL_mixer.d' to make sdl_mixer.obj, then 'lib -c -l sdl_mixer sdl_mixer.obj' to make the lib. But then when I compile a simple program, at linking, I get errors for undefined symbols. The functions mentioned are (prototyped at least) in sdl_mixer.d. Is there an option in the compiler to keep the functions that are prototyped but not defined? Or do I need to pass an option with the .dll name so that it can verify that those functions really exist? Thanks, Triften Chmil
Sep 13 2005
"Triften Chmil" <Triften_member pathlink.com> wrote in message news:dg6eak$14o1$1 digitaldaemon.com...Is there an option in the compiler to keep the functions that are prototyped but not defined? Or do I need to pass an option with the .dll name so that it can verify that those functions really exist?I really wish there were. What you'll have to do instead is have two modules: sdl_mixer.d and sdl_mixer_imports.d. Copy all the function prototypes of the undefined functions to sdl_mixer_imports.d. place an "import sdl_mixer_imports;" statement at the top of sdl_mixer.d. Compile _only_ sdl_mixer.d; do not compile sdl_mixer_imports.d. Then make your lib. Those references should hopefully appear in your lib file.
Sep 13 2005
Triften Chmil escribió:I'm trying to compile a .d and make a .lib but the .lib seems to be missing functions. I verified the behavior by generating a .lst and seeing that some functions from the .d weren't in the .lst. Specifically, I'm trying to compile a .lib for sdl_mixer. I got SDL_mixer.dll from libsdl.org and 'sdl_mixer.d' from D-Porting. I ran 'dmd -c SDL_mixer.d' to make sdl_mixer.obj, then 'lib -c -l sdl_mixer sdl_mixer.obj' to make the lib. But then when I compile a simple program, at linking, I get errors for undefined symbols. The functions mentioned are (prototyped at least) in sdl_mixer.d. Is there an option in the compiler to keep the functions that are prototyped but not defined? Or do I need to pass an option with the .dll name so that it can verify that those functions really exist? Thanks, Triften ChmilYou need to import the .dll in a .lib using 'lib', not creating a D module. Check the docs for the lib tool to know how to use it. -- Carlos Santander Bernal
Sep 13 2005
In article <dg7qqm$2h1m$1 digitaldaemon.com>, Carlos Santander says...Triften Chmil escribió:I don't see any mention of dll's on the doc page for 'lib'. Where does it talk about this? Oh wait, I think I need to run COFF2OMF on the .lib I have. Thanks, Triften ChmilI'm trying to compile a .d and make a .lib but the .lib seems to be missing functions. I verified the behavior by generating a .lst and seeing that some functions from the .d weren't in the .lst. Specifically, I'm trying to compile a .lib for sdl_mixer. I got SDL_mixer.dll from libsdl.org and 'sdl_mixer.d' from D-Porting. I ran 'dmd -c SDL_mixer.d' to make sdl_mixer.obj, then 'lib -c -l sdl_mixer sdl_mixer.obj' to make the lib. But then when I compile a simple program, at linking, I get errors for undefined symbols. The functions mentioned are (prototyped at least) in sdl_mixer.d. Is there an option in the compiler to keep the functions that are prototyped but not defined? Or do I need to pass an option with the .dll name so that it can verify that those functions really exist? Thanks, Triften ChmilYou need to import the .dll in a .lib using 'lib', not creating a D module. Check the docs for the lib tool to know how to use it. -- Carlos Santander Bernal
Sep 14 2005
Triften Chmil escribió:I don't see any mention of dll's on the doc page for 'lib'. Where does it talk about this? Oh wait, I think I need to run COFF2OMF on the .lib I have. Thanks, Triften ChmilMy bad, sorry. It's implib, like Jarrett said. -- Carlos Santander Bernal
Sep 14 2005