Author Topic: No stdlib, custom startup code - GDB doesn't work  (Read 6311 times)

Offline Mr.Madguy

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: No stdlib, custom startup code - GDB doesn't work
« Reply #15 on: April 24, 2023, 08:46:57 pm »
If somebody is interested, for now problem with anti-virus is fixed via comparing my C++ code with similar ASM program, that doesn't have such problems. Looks like anti-viruses hate GetModuleHandle("KERNEL32.DLL"). It's better to use LoadLibrary/FreeLibrary instead.

Another question - why it's necessary to install 32bit gcc in order to compile for 32bit target (i.e. -m32)? Why there is no cross-compile option? According to error messages 64bit compiler can't find 32bit libraries when using -m32. So may be there is some way to configure paths instead of using 32bit compiler?
Is it healthy for project not to have regular stable releases?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: No stdlib, custom startup code - GDB doesn't work
« Reply #16 on: April 25, 2023, 12:57:57 am »
If somebody is interested, for now problem with anti-virus is fixed via comparing my C++ code with similar ASM program, that doesn't have such problems. Looks like anti-viruses hate GetModuleHandle("KERNEL32.DLL"). It's better to use LoadLibrary/FreeLibrary instead.

Another question - why it's necessary to install 32bit gcc in order to compile for 32bit target (i.e. -m32)? Why there is no cross-compile option? According to error messages 64bit compiler can't find 32bit libraries when using -m32. So may be there is some way to configure paths instead of using 32bit compiler?

For "-m32" to work for complex programs; the Compiler Builder needs to build the support libraries for 32 bit. Most of the 64 bit Compilers that support "-m32" do not build very many 32 bit libraries.

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

Offline nenin

  • Almost regular
  • **
  • Posts: 202
Re: No stdlib, custom startup code - GDB doesn't work
« Reply #17 on: April 25, 2023, 07:42:21 am »
Another question - why it's necessary to install 32bit gcc in order to compile for 32bit target (i.e. -m32)? Why there is no cross-compile option? According to error messages 64bit compiler can't find 32bit libraries when using -m32. So may be there is some way to configure paths instead of using 32bit compiler?
It is long story.  Actually they exists, but likely you dont want them: "https://sourceforge.net/projects/mingw-w64/files/Multilib Toolchains(Targetting Win32 and Win64)/ "
My experience with multiply mingw compilers (I have now 3 actually in use, 32b, 32b for XP and 64b) is like this: I use bat files which switch path and I have different  configs in CB. And there are no big problems to switch.