Wow, what a headache I just had.
WinXP
1.0RC2 (oct.24) and SVN-rev1615-uni
I could build an .exe with RC1, but the exact same project and settings cannot build in SVN-rev1615-uni. Rev1615 gives this error message on linking:
mingw_gcc344\Release\Controls.o:Controls.cpp:(.text+0x0): multiple definition of `main'
mingw_gcc344\Release\Controls.o:Controls.cpp:(.text+0x0): first defined here
I was racking my brain because I thought the problem was my code (which has 2 "main") and libs:
int main(int argc, char *argv[])
{
Application* app = new ControlsApplication( argc, argv );
Application::main();
return 0;
}
You can imagine how many lib rebuilds I did thinking something was wrong with my lib build settings.
Anyway, it turns out I think it is related to resource file extensions. Here is the succesful exe build output with RC1 (note the two compiled files controls.o and controls.res, ok):
Project : Controls
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Dev\VCF\vcf\examples\Controls\
--------------------------------------------------------------------------------
Switching to target: Win32 Release
mingw32-g++.exe -LC:\Dev\CodeBlocks\lib -o C:\Dev\VCF\vcf\examples\Controls\mingw_gcc344\Release\Controls.exe mingw_gcc344\Release\ControlsAbout.o mingw_gcc344\Release\ControlsApplication.o mingw_gcc344\Release\MainWindow.o mingw_gcc344\Release\Controls.o mingw_gcc344\Release\Controls.res -Wl,--enable-runtime-pseudo-reloc -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 ..\..\bin\libApplicationKitDLL_mingw_gcc344.a ..\..\bin\libGraphicsKitDLL_mingw_gcc344.a ..\..\bin\libFoundationKitDLL_mingw_gcc344.a -mwindows
Info: resolving vtable for VCF::Rectby linking to __imp___ZTVN3VCF4RectE (auto-import)
Info: resolving vtable for VCF::StandardContainerby linking to __imp___ZTVN3VCF17StandardContainerE (auto-import)
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
Now, with SVN-1615uni, the bad build looks like so (notice 2 controls.o and no controls.res):
-------------- Build: Win32 Release in Controls ---------------
mingw32-g++.exe -LC:\Dev\MinGW344\lib -o C:\Dev\VCF\vcf\examples\Controls\mingw_gcc344\Release\Controls.exe mingw_gcc344\Release\ControlsAbout.o mingw_gcc344\Release\ControlsApplication.o mingw_gcc344\Release\MainWindow.o mingw_gcc344\Release\Controls.o mingw_gcc344\Release\Controls.o -Wl,--enable-runtime-pseudo-reloc -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 ..\..\bin\libApplicationKitDLL_mingw_gcc344.a ..\..\bin\libGraphicsKitDLL_mingw_gcc344.a ..\..\bin\libFoundationKitDLL_mingw_gcc344.a -mwindows
Info: resolving vtable for VCF::Rectby linking to __imp___ZTVN3VCF4RectE (auto-import)
Info: resolving vtable for VCF::StandardContainerby linking to __imp___ZTVN3VCF17StandardContainerE (auto-import)
mingw_gcc344\Release\Controls.o:Controls.cpp:(.text+0x0): multiple definition of `main'
mingw_gcc344\Release\Controls.o:Controls.cpp:(.text+0x0): first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings
So, it appears to be compiling controls.cpp twice and not controls.rc. Here are the lines from the .cbp file showing the 2 controls file:
</Build>
<Unit filename="Controls.cpp">
<Option compilerVar="CPP" />
<Option target="Win32 Release" />
<Option target="Win32 Debug" />
</Unit>
<Unit filename="Controls.rc">
<Option compilerVar="WINDRES" />
<Option objectName="Controls.res" />
<Option target="Win32 Release" />
<Option target="Win32 Debug" />
</Unit>
Is this a bug (I think so) or something I'm doing wrong? I'll report this to sourceforge soon when I'm certain it is a bug and not something I'm doing wrong.
Grunerite