Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Import library filename not work / not saved !

(1/2) > >>

Feneck91:
I'm creating dynamic libraries with codeblocks SVN 7141.
In project properties / Build Targets, I choose Type = Dynamic Library
To be able to link with this lib, I must create a .a (MinGW)  or .lib (Visual) and check "Create import library"
ok, no problem.

In the field import library filename I change $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME) by lib\$(TARGET_OUTPUT_BASENAME)
to be able to write the lib (.a) into the project folder under "lib" directory.
1> If the lib folder doesn't exists, it is not created automatically, why ? So, I must create lib folder and it's work.
2> I save all (project / workspace / files / etc) and quit Code::Blocks.
3> Run Codeblocks and re-open workspace / projetc.
4> In the field import library filename there is no change: it left $(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME) and no lib\$(TARGET_OUTPUT_BASENAME) so this option is not saved properly.

Any idea ?

MortenMacFly:
You misunderstood the option. "import library filename" does really ONLY mean the file's name, not including a path. To setup the path you need to change the "output filename" accordingly (the one where you can actually pick a file with the "..." button).

If you are unsure, leave the filed "import file name" as it is.

Feneck91:
Thanks for your reply.

Imagine, I have a /RootWorkspace/FooProject

If I want to generate a dynamic library foo into ../bin/Debug/foo.dll (so in /RootWorkspace/bin/Debug/foo.dll)
and a library file (.a) into FooProject/lib/foo.a
How I can do ? Is it possible or the dll file and .a are always generated at the same place ?

Because I a several dll / exe and I want to link all executable into ../bin/Debug (or release) directory and let all lib into their respective folder project path.

MortenMacFly:

--- Quote from: Feneck91 on May 17, 2011, 05:02:17 pm ---If I want to generate a dynamic library foo into ../bin/Debug/foo.dll (so in /RootWorkspace/bin/Debug/foo.dll)
and a library file (.a) into FooProject/lib/foo.a
How I can do ?

--- End quote ---
You can only do, what the compiler allows to do. GCC does not allow that.

So: EITHER you put everything in ../bin/Debug/, add this path to the linker options and remove the export libraries for distribution OR you create everything in FooProject/lib/ and copy the DLL to ../bin/Debug/ in a post build step (probably using macros to make it more generic).

Feneck91:
I thought like you, so I create everything in FooProject/lib/ and copy the DLL to ../bin/Debug/ in a post build step but in DOS MODE (copy).
What is macro ? Is it possible to make generic copy (not depending on target plateform ?

--- Quote ---(probably using macros to make it more generic).
--- End quote ---
What kind of macros ?
I use to copy wxWidgets dll from to bin\output\ I use script like :

--- Code: ---[[IO.CopyFile(_("$(#wx)/lib/gcc_dll/wxmsw$(#wxver)ud_gcc.dll"), _("../bin/$(output)/wxmsw$(#wxver)ud_gcc.dll"),false);]]

--- End code ---
But it always as me if it is confidence or not... Not really cool to use. Another way ?

Navigation

[0] Message Index

[#] Next page

Go to full version