Author Topic: Linker produces the wrong file extension  (Read 7515 times)

pac

  • Guest
Linker produces the wrong file extension
« on: February 03, 2007, 10:19:24 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Linker produces the wrong file extension
« Reply #1 on: February 03, 2007, 10:48:53 pm »
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
« Last Edit: February 03, 2007, 11:00:12 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

pac

  • Guest
Re: Linker produces the wrong file extension
« Reply #2 on: February 04, 2007, 12:32:33 pm »
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




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Linker produces the wrong file extension
« Reply #3 on: February 04, 2007, 02:12:59 pm »
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++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

pac

  • Guest
Re: Linker produces the wrong file extension
« Reply #4 on: February 04, 2007, 03:26:50 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Linker produces the wrong file extension
« Reply #5 on: February 04, 2007, 04:02:38 pm »
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++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

pac

  • Guest
Re: Linker produces the wrong file extension
« Reply #6 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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Linker produces the wrong file extension
« Reply #7 on: February 04, 2007, 06:03:26 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
« Last Edit: February 04, 2007, 06:05:11 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

pac

  • Guest
Re: Linker produces the wrong file extension
« Reply #8 on: February 04, 2007, 06:22:56 pm »
where is the appropriate place to report a bug ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Linker produces the wrong file extension
« Reply #9 on: February 04, 2007, 06:27:13 pm »
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.codeblocks.org/index.php?topic=5100.msg39848#msg39848

Tim S
« Last Edit: February 04, 2007, 06:31:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org