Steps to reproduce:
1) Start codeblocks
2) New project from template "Empty project"
3) Give a name and leave everything else as default
4) New build target from template "Dynamic link library"
5) Give a name (I used 'dll') and leave everything else as default
6) Build
Result:
after some seconds in which everything seems freezed, a window shows up.
It is standard Windows error message for crashes:
<The instruction at "0x00000434" referenced memory at "0x00000434". The memory could not be "read".>
The previous line in the call stack is:
6194EB5A call ecx
with ecx = 1076 = 0x00000434 (but it varies every time)
Then a codeblocks.RPT is created.
NOTICE THIS:
If you re-execute the same steps without deleting the codeblocks.RPT file, the standard Windows error message is NOT shown, instead a new window is shown:
"Exception!"
And, in short, it says this:
- error at:
sdk\compilercommandgenerator.cpp, on line 101
- error message:
Compiler for target 'dll' is invalid!
Why the 2 different behaviours depending on the presence/absence of the "codeblocks.RPT" file?
OS:
Windows 2000 SP4
CodeBlocks version (nightly build):
Version 1.0 revision 2740 () gcc 3.4.5 Windows/unicode
codeblocks.RPT:
-------------------
Error occured on Saturday, July 15, 2006 at 15:30:27.
C:\CodeBlocks\Installed\codeblocks.exe caused an Access Violation at location 00000434 Reading from location 00000434.
Registers:
eax=00000001 ebx=0022f04c ecx=00000434 edx=474e5543 esi=661784f8 edi=02447c90
eip=00000434 esp=0022f024 ebp=0022f060 iopl=0 nv up ei pl nz na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00010202
Call stack:
00000434
6194EB5C C:\CodeBlocks\Installed\codeblocks.dll:6194EB5C _ZN7SQLexer6ReadIDEv
61944EB5 C:\CodeBlocks\Installed\codeblocks.dll:61944EB5 _ZN7SQLexer6ReadIDEv
617F5ED2 C:\CodeBlocks\Installed\codeblocks.dll:617F5ED2 _ZN24CompilerCommandGenerator4InitEP9cbProject
617ECD98 C:\CodeBlocks\Installed\codeblocks.dll:617ECD98 _ZN8Compiler4InitEP9cbProject
660D067B C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660D067B PluginSDKVersion
660D1720 C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660D1720 PluginSDKVersion
660D2237 C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660D2237 PluginSDKVersion
660D2315 C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660D2315 PluginSDKVersion
660D3FFA C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660D3FFA PluginSDKVersion
660C4D9F C:\CodeBlocks\Installed\share\codeblocks\plugins\compilergcc.dll:660C4D9F PluginSDKVersion
100AA808 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100AA808 _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
100AABCC C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100AABCC _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
100ABBA9 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABBA9 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
100ABB49 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ABB49 _ZN12wxEvtHandler12ProcessEventER7wxEvent
101B30A3 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:101B30A3 _ZN11wxFrameBase14ProcessCommandEi
1013868F C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:1013868F _ZN7wxFrame13HandleCommandEttPv
10138DB6 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:10138DB6 _ZN7wxFrame13MSWWindowProcEjjl
1010D6D0 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:1010D6D0 _Z9wxWndProcP6HWND__jjl@16
77E4158F C:\WINNT\system32\USER32.dll:77E4158F __imp__GetViewportExtEx@8
77E41DC9 C:\WINNT\system32\USER32.dll:77E41DC9 __imp__GetViewportExtEx@8
77E41E7E C:\WINNT\system32\USER32.dll:77E41E7E __imp__GetViewportExtEx@8
100ED0A4 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ED0A4 _ZN11wxEventLoop8DispatchEv
100ECE40 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100ECE40 _ZN11wxEventLoop3RunEv
10186AFE C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:10186AFE _ZN9wxAppBase8MainLoopEv
004046E4 C:\CodeBlocks\Installed\codeblocks.exe:004046E4
10043B67 C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:10043B67 _Z14wxUninitializev
100B3ADA C:\CodeBlocks\Installed\wxmsw26u_gcc_cb.dll:100B3ADA _Z7wxEntryP11HINSTANCE__S0_Pci
004014D8 C:\CodeBlocks\Installed\codeblocks.exe:004014D8
00467C7A C:\CodeBlocks\Installed\codeblocks.exe:00467C7A
00401237 C:\CodeBlocks\Installed\codeblocks.exe:00401237
004012A8 C:\CodeBlocks\Installed\codeblocks.exe:004012A8
7C598989 C:\WINNT\system32\KERNEL32.dll:7C598989 ProcessIdToSessionId
I have a current workaround like this :
wxString Wiz::GetTargetCompilerID()
{
wxString CompilerId = CompilerFactory::GetDefaultCompilerID();
if (m_pWizBuildTargetPanel)
{
CompilerId = m_pWizBuildTargetPanel->GetCompilerID();
if(CompilerId == wxEmptyString)
{
CompilerId = CompilerFactory::GetDefaultCompilerID();;
// show message that no compiler stated and we falling back tpo the default one
}
}
else
{
// show message that no compiler stated and we falling back tpo the default one
}
return CompilerId;
}
The save(workaround) in the above mentioned examples is now carried out by that reassignemn of the default compiler set in CB. Might commit this code tomorrow, or could fall back on the project one. But note : this is a workaround, not the real place to fix.