News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Linker produces the wrong file extension

Started by pac, February 03, 2007, 10:19:24 PM

Previous topic - Next topic

pac

When building a library and assignint to it the .lib extension

despite the builder log which says :

Linking static library: bin\Release\libmrf.lib
Process terminated with status 0 (0 minutes, 48 seconds)
0 errors, 0 warnings


the linker still produces the library with the .a extension.
Conseuauence : there is not libmrf.lib created but a libmrf.a is produced

is it a bug or am I missing something ?

Best regards

stahta01

#1
What compiler are you using?

.a is a minGW GCC library
.lib is a MS VC Library

Code::Blocks is a IDE it does NOT give extra abilities to the compiler.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

pac

I am using Mingw tools

This is not about giving extra capabilities to the linker/compiler.
This is about giving it the argument specified in the text field Widget of the configuration dialog box.

THe Gnu Ld compler let you specify the file extension of  a dynamic library.

Example (which works perfectly with the command line):

g++ -o build/accelerators/libmrfaccelerators.lib -shared build/accelerators/Voxel.os build/accelerators/AccGrid.os build/accelerators/IVBase.os build/accelerators/IVVertexGrid.os

For static library you have the same feature because  the ar utility let you specify the extension too.


Best Regards




stahta01

You do realize that just changing the extension to .lib does NOT make the output an MSVC compatible .lib.

If you wish to do this with code::blocks did you turn off.
"Auto Generate filename extension" and you most likely want to turnoff "Auto generate filename prefix"

Look for the above under "Project" -> "Properties" Tab "targets"

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

pac

arf...

Of course  I realize that and of course I tried to turnoff the options you're talking about
It does not produce the appropriate result (at least with  the nightly build of  the 24th January)

I think its a bug...


Pac

stahta01

Turn on compile logging and see what the commands C::B is producing.
Tim S

From Pecan answer to other thread
//-- Full Compile Logging --
   Main Menu->Settings->Compiler and Debugger->"Other"->Compiler logging = "Full command line".
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

pac

With this settings set

this shows that the wrong file extension
is passed to the command ar
and thus producing the wrong library


Pac

stahta01

#7
Quote from: pac on February 04, 2007, 05:16:10 PM
With this settings set

this shows that the wrong file extension
is passed to the command ar
and thus producing the wrong library


Pac

After, making sure you changed the name in the project properties.

I would then suggest making a small test case of project file and source and header and attaching it to this thread and also submitting a bug report on it. Note, the fact if the problem happens on static or dynamic or both types of libraries.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

pac

where is the appropriate place to report a bug ?

stahta01

#9
From http://www.codeblocks.org/

http://developer.berlios.de/projects/codeblocks/

http://developer.berlios.de/bugs/?func=addbug&group_id=5358

Note: If Berlios still has the DDoS issue you may need to change http:// to https://

You can also read this thread about reporting bugs
http://forums.next.codeblocks.org/index.php?topic=5100.msg39848#msg39848

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]