User forums > Help

Trouble creating import library

<< < (2/2)

Bill:
I have done some searching and found that the way to create an import lib is via the "/def" option to the linker. So, for example, I can make Plugin_CgProgramManager build a import library by adding  "/dev:..\misc\OgreCgProgramManager.def" to the linker options.


This doesn't answer the question as to why it builds the library in some cases and why it doesn't in others without the option specified.  :(


[Edit] In case anyone is interested, and after a few more bumps, I did finally get OGRE to compile and run with C::B and the free MS C++ compiler. As OGRE is rather involved I think this shows that C::B with the MS compiler is a viable alternative to visual studio.

RayGun:
In case anyone is interesed, I ran into this problem myself, yesterday. What I found out, is that VC++ linker doesn't generate import library if there's nothing to export (or so it seems to be). Despite the fact that my dll project had def file in it, C::B build system obviously just ignored it. So I used /EXPORT keys (I guess, /DEF also would work).

As to why some of your projects generated libs and some didn't. Maybe those projects that generated import libraries use __declspec(dllexport) to tell the compiler about the symbols to be exported.

So, to summarize, there are three ways to export something -
1) def file
2) /EXPORT key
3) __declspec(dllexport) in the source

If your project doesn't use any of these, you don't get a lib for your dll.

Navigation

[0] Message Index

[*] Previous page

Go to full version