Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#Actualdmatter

Posted 29 November 2013 - 04:40 PM

I've checked the linker settings in Code::Blocks and neither of those libraries were present (at least I couldn't see if they were there).  I added each one in turn (separately) and the linker reported that neither of the libraries were present on my system.

I'm not really familiar with C::B, when you added the lib did you put the -l prefix on? It's quite possible you need to link to the library differently in C::B than you would from the commandline (e.g. maybe with a fullblown path rather than the -l shorthand stuff). Or maybe it just doesn't know where the lib is (mis)located; there will be a way to add a lib directory if that's the case.

Can you find libmingw32.a in your mingw install? I believe this is a library you need to link with and to do so ahead of your custom lib containing WinMain.

My current hypothesis is this:
Your WinMain is in a separate lib, while the MS compiler is fine with that GCC is not because it will not link unused symbols and WinMain is, at that point, unused. The fix is to link with mingw32, a teeny(?) library that just has a regular main() function that forwards onto your WinMain function. You link it in ahead of your custom lib which therefore causes the linker to actually use your WinMain rather than ignore it.

#3dmatter

Posted 29 November 2013 - 04:38 PM

I've checked the linker settings in Code::Blocks and neither of those libraries were present (at least I couldn't see if they were there).  I added each one in turn (separately) and the linker reported that neither of the libraries were present on my system.

I'm not really familiar with C::B, when you added the lib did you put the -l prefix on? It's quite possible you need to link to the library differently in C::B than you would from the commandline (e.g. maybe with a fullblown path rather than the -l shorthand stuff). Or maybe it just doesn't know where the lib is (mis)located; there will be a way to add a lib directory if that's the case.

Can you find libmingw32.a in your mingw install? I believe this is a library you need to link with and to do so ahead of your custom lib containing WinMain.

My current hypothesis is this:
Your WinMain is in a separate lib, while the MS compiler is fine with that GCC is not because it will not link unused symbols and WinMain is, at that point, unused. The fix is therefore to link with mingw32, a teeny(?) library that has a regular main() function that forwards onto your WinMain function. You link it in ahead of your custom lib which therefore causes the linker to actually use your WinMain rather than ignore it.

#2dmatter

Posted 29 November 2013 - 04:28 PM

I've checked the linker settings in Code::Blocks and neither of those libraries were present (at least I couldn't see if they were there).  I added each one in turn (separately) and the linker reported that neither of the libraries were present on my system.

I'm not really familiar with C::B, when you added the lib did you put the -l prefix on? It's quite possible you need to link to the library differently in C::B than you would from the commandline (e.g. maybe with a fullblown path rather than the -l shorthand stuff). Or maybe it just doesn't know where the lib is (mis)located.

Can you find libmingw32.a in your mingw install? I believe this is a library you need to link with and to do so ahead of your custom lib containing WinMain.

My current hypothesis is this:
Your WinMain is in a separate lib, while the MS compiler is fine with that GCC is not because it will not link unused symbols and WinMain is, at that point, unused. The fix is therefore to link with mingw32, a teeny(?) library that has a regular main() function that forwards onto your WinMain function. You link it in ahead of your custom lib which therefore causes the linker to actually use your WinMain rather than ignore it.

#1dmatter

Posted 29 November 2013 - 04:27 PM

I've checked the linker settings in Code::Blocks and neither of those libraries were present (at least I couldn't see if they were there).  I added each one in turn (separately) and the linker reported that neither of the libraries were present on my system.

I'm not really familiar with C::B, when you added the lib did you put the -l prefix on? It's quite possible you need to link to the library different in C::B than you would from the commandline (e.g. maybe with a fullblown path rather than the -l shorthand stuff). Or maybe it just doesn't know where the lib is (mis)located.

Can you find libmingw32.a in your mingw install? I believe this is a library you need to link with and to do so ahead of your custom lib containing WinMain.

My current hypothesis is this:
Your WinMain is in a separate lib, while the MS compiler is fine with that GCC is not because it will not link unused symbols and WinMain is, at that point, unused. The fix is therefore to link with mingw32, a teeny(?) library that has a regular main() function that forwards onto your WinMain function. You link it in ahead of your custom lib which therefore causes the linker to actually use your WinMain rather than ignore it.

PARTNERS