User forums > Using Code::Blocks

.def & import library names

(1/7) > >>

rcrnstn:
When building "Test.dll" I expect the other files to be named "libTest.def" and "libTest.a".
Instead they are called "libTest.dll.def" and libTest.dll.a". Why is this? Is it by design or am I missing something?

I am basing my project on the "Dynamic Link Library" template.
In "Project Options->Build Targets" I have ticked the "Create import library" and "Create .DEF exports file".
I also have "Auto-generate filename prefix" and "Auto-generate filename extension" ticked. My output filename is Test.dll

For now I have solved the problem by unticking "Create import library" and "Create .DEF exports file" and added
-Wl,--output-def=libTest.def
-Wl,--out-implib=libTest.a
to my "Other Link Options"

I'd appreciate any reply

Ceniza:
I had the exact same complaint to the developer who added that "feature". The reason he added that behavior is that when you want to create an output file which is really a DLL but with another extension and dots in its name (like this.is.evil.plugin), he won't get what he wants. The current behavior works lovely for all cases (according to him). I also think this behavior is 'wrong' (as in 'it is not what one would expect to happen' and 'it is not what one wants to happen'). Although, he is willing to accept a change as long as it also works fine with his scenario. Thing is, no solution has been discussed at all.

The solution would most likely involve adding another checkbox and/or an extra text field (extension?). Ideas are welcomed.

johne53:
On the face of it, this would seem to be a simple problem to fix - i.e. if the target DLL has a non-standard extension, append ".dll.a" or ".dll.def" or whatever is appropriate. But if its extension is the standard ".dll" just replace that extension with ".lib", ".a" or ".def". Or even better - allow the user some choice.

In any case, this only seems to be a problem when certain compilers are selected. If it can work sensibly with some compiler selections why can't it be made to work sensibly for the others???

MortenMacFly:

--- Quote from: johne53 on October 26, 2009, 09:59:35 pm ---But if its extension is the standard ".dll" just replace that extension with ".lib", ".a" or ".def". Or even better - allow the user some choice.

--- End quote ---
It's not as easy as that. You have to take into consideration the user's ability to have C::B autogenerate the prefix and extension.

So - Ceniza:
As I am unaware to find what I am looking for... I nned two posts as reference:
1.) The one of TDragon where he explains the required handling with the MinGW/GCC compiler
2.) Your post with a first suggestion about "required checkboxes".
[Edit]: 3.) Not to forget: The SVN revision where this change was introduced. :lol:

Hence where are they??? :?

johne53:

--- Quote from: MortenMacFly on October 27, 2009, 06:53:56 am ---It's not as easy as that. You have to take into consideration the user's ability to have C::B autogenerate the prefix and extension.
--- End quote ---

Morten - I don't understand how that complicates the situation. Can you give an example?

My perspective (which admittedly hasn't had much thought put into it) goes something like this:-

1) Regardless of how the target DLL's extension gets generated, it will either be standard or non-standard.
2) If it's non-standard, append ".a" or ".lib" or ".def" (or whatever) when generating the link library and def files.
3) Alternatively, if it's the standard ".dll" or ".so" replace the extension, instead of appending a further extension (or at least offer this as an option).

Navigation

[0] Message Index

[#] Next page

Go to full version