Author Topic: Cannot have an empty lib prefix in the gcc compiler (and copies)  (Read 3755 times)

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
LS,
I'm having problems having an empy lib prefix in the gcc compiler (I use a arm realview compiler so I made a copy of the gcc compiler).
When I set the prefix to "aaaa" in the advanced compiler options dialog (others) I see that an entry is created in the default.conf of:
<LIBPREFIX>
<str>
<![CDATA[aaaa]]>
</str>
</LIBPREFIX>

If I modify it to
<LIBPREFIX>
<str>
<![CDATA[]]>
</str>
</LIBPREFIX>

codeblocks seems to remove the entry after a restart and use the default lib prefix "lib".
How can I have an empty libprefix?

Jan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #1 on: April 25, 2007, 02:30:02 pm »
What happens if set a space as prefix? Does it detect that too and removes it?
Be patient!
This bug will be fixed soon...

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #2 on: April 25, 2007, 02:35:36 pm »
No a space is added to the lib name so "lib.ext" --> " lib.ext"

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #3 on: April 25, 2007, 02:47:16 pm »
I see that when I enter a space as libprefix the libprefix key in the default.conf file is preserved and not deleted after a restart:         

<LIBPREFIX>
   <str>
      <![CDATA[ ]]>
   </str>
</LIBPREFIX>

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #4 on: April 25, 2007, 04:40:50 pm »
HI all,
I tracked down the problem to sc/sdk/compiler.cpp line 408

In my opinion this line:
  cfg->Write(tmp + _T("/switches/libPrefix"), m_Switches.libPrefix, true);

should be changed into

  cfg->Write(tmp + _T("/switches/libPrefix"), m_Switches.libPrefix, false);

Jan

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #5 on: April 25, 2007, 06:00:05 pm »
Quote
I tracked down the problem to sc/sdk/compiler.cpp line 408

Yes, the problem is not that I don't know where it skips saving empty values :), but rather how to handle this situation.

The problem here is that an empty lib prefix means "use default lib prefix for platform". So it's not a matter of saving it as empty or not but how to correctly distinguish between the "use default" value and a string set as empty on purpose.
Be patient!
This bug will be fixed soon...

Offline Jan van den Borst

  • Multiple posting newcomer
  • *
  • Posts: 99
Re: Cannot have an empty lib prefix in the gcc compiler (and copies)
« Reply #6 on: April 25, 2007, 06:08:49 pm »
Hi mandrav
When you change the code as I proposed there is no change in functional behavior of the compiler.

I think if you allow the prefix to be changed (in the advance option dialog) it must be possible to change it basically to anything including leaving it empty.

Changing an empty string back to "lib" is confusing. I think if the config file contains a field libprefix codeblocks should take this value.

Kind regards
Jan