News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

cannot set default compiler

Started by cbnewbie, April 08, 2017, 11:01:07 PM

Previous topic - Next topic

cbnewbie

Whenever I start codeblocks I see the dialog box to set the default compiler (gcc) but I cannot save the settings. Next time I start codeblocks it will ask me again...

I am using codeblocks svn build  rev 11045 Apr  8 2017, 17:13:43 - wx3.0.2 (Linux, unicode) - 64 bit. gcc is installed in /bin:

$ which ar g++ gcc make
/bin/ar
/bin/g++
/bin/gcc
/bin/make
$

oBFusCATed

Does c::b crash when you close it? Does it have proper permissions to save the default.conf file in ~/.config/codeblocks/default.conf?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cbnewbie

No, it does not crash.

$ ls -l .config/codeblocks/default.conf
-rw-r--r-- 1 mer mer 54727 Apr  9 02:02 .config/codeblocks/default.conf
$

I am user "mer".

stahta01

Did you scroll down on the screen and see if another compiler has the setting problem?

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

cbnewbie

I have just removed clang to see whether the problem remains if only gcc is installed. Nothing changed. On my system cb ist installed in $HOME/IDE. Can this cause troubles?

cbnewbie

I have just tried to change the compiler settings from inside cb. It seems that cb finds the required executables (gcc, etc.) but it does not set the path. And if I click on "Reset defaults" I get an error message:

ASSERT INFO:
./include/wx/msgdlg.h(138): assert "!(style & wxNO_DEFAULT) || (style & wxNO)" failed in SetMessageDialogStyle(): wxNO_DEFAULT is invalid without wxNO

BACKTRACE:
[1] wxMessageDialog::wxMessageDialog(wxWindow*, wxString const&, wxString const&, long, wxPoint const&)
[2] cbMessageBox(wxString const&, wxString const&, int, wxWindow*, int, int)
[3] CompilerOptionsDlg::OnResetCompilerClick(wxCommandEvent&)
[4] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[5] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[6] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[7] wxEvtHandler::TryHereOnly(wxEvent&)
[8] wxEvtHandler::ProcessEventLocally(wxEvent&)
[9] wxEvtHandler::ProcessEvent(wxEvent&)
[10] wxWindowBase::TryAfter(wxEvent&)
[11] wxWindowBase::TryAfter(wxEvent&)
[12] wxWindowBase::TryAfter(wxEvent&)
[13] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[14] g_closure_invoke
[15] g_signal_emit_valist
[16] g_signal_emit
[17] g_closure_invoke
[18] g_signal_emit_valist
[19] g_signal_emit
[20] g_closure_invoke
[21] g_signal_emit_valist
[22] g_signal_emit
[23] gtk_propagate_event
[24] gtk_main_do_event
[25] g_main_context_dispatch
[26] g_main_loop_run
[27] gtk_main
[28] wxGUIEventLoop::DoRun()
[29] wxEventLoopBase::Run()
[30] wxDialog::ShowModal()
[31] MainFrame::OnSettingsCompiler(wxCommandEvent&)
[32] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[33] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[34] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[35] wxEvtHandler::TryHereOnly(wxEvent&)
[36] wxEvtHandler::DoTryChain(wxEvent&)
[37] wxEvtHandler::ProcessEvent(wxEvent&)
[38] wxWindowBase::TryAfter(wxEvent&)
[39] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[40] wxMenuBase::SendEvent(int, int)
[41] g_closure_invoke
[42] g_signal_emit_valist
[43] g_signal_emit
[44] gtk_widget_activate
[45] gtk_menu_shell_activate_item
[46] g_closure_invoke
[47] g_signal_emit_valist
[48] g_signal_emit
[49] gtk_propagate_event
[50] gtk_main_do_event
[51] g_main_context_dispatch
[52] g_main_loop_run
[53] gtk_main
[54] wxGUIEventLoop::DoRun()
[55] wxEventLoopBase::Run()
[56] wxAppConsoleBase::MainLoop()
[57] CodeBlocksApp::OnRun()
[58] wxEntry(int&, wchar_t**)
[59] main
[60] __libc_start_main
[61] _start /home/iurt/rpmbuild/BUILD/glibc-2.22/csu/../sysdeps/x86_64/start.S:121

BlueHazzard

does the date/time of the config file change if you close codeblocks?
If you set the path by hand, save and close c::b does this work?

oBFusCATed

What happens if you click on the ignore button (don't know exact spelling) on the assert message dialog?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cbnewbie

@BlueHazzard:

Date/time of default.conf changes when I close cb. Is it written every time when I close cb? However, the next time I start cb after explicitely setting the path cb does not remember the setting. It will again tell me that gcc has been detected and shows an empty path field.

$ cp default.conf default.conf.org

... running and closing cb after setting path to /bin ...

$ diff default.conf default.conf.org
878c878
<                                               <![CDATA]>
---
>                                               <![CDATA[fun]]>
883c883
<                                               <![CDATA[subroutine |()\n    \nend subroutine\n]]>
---
>                                               <![CDATA[function |()\n    \nend function\n]]>
895c895
<                                               <![CDATA[fun]]>
---
>                                               <![CDATA]>
900c900
<                                               <![CDATA[function |()\n    \nend function\n]]>
---
>                                               <![CDATA[subroutine |()\n    \nend subroutine\n]]>
1105c1105
<                                               <![CDATA[tday]]>
---
>                                               <![CDATA[guard]]>
1110c1110
<                                               <![CDATA[$TDAY]]>
---
>                                               <![CDATA[#ifndef $(Guard token)\n#define $(Guard token)\n\n|\n\n#endif // $(Guard token)\n]]>                                                                                                                                         
1117c1117                                                                                                                                 
<                                               <![CDATA[guard]]>                                                                         
---                                                                                                                                       
>                                               <![CDATA[tday]]>                                                                           
1122c1122                                                                                                                                 
<                                               <![CDATA[#ifndef $(Guard token)\n#define $(Guard token)\n\n|\n\n#endif // $(Guard token)\n]]>                                                                                                                                         
---                                                                                                                                       
>                                               <![CDATA[$TDAY]]>
1416,1420d1415
<                               <MASTER_PATH>
<                                       <str>
<                                               <![CDATA[/bin]]>
<                                       </str>
<                               </MASTER_PATH>
$


@oBFusCATed:

There are two buttons: Continue and Stop. If I click on Continue the error message will appear again. If I click on Stop cb will crash.

oBFusCATed

Click the second continue. What happens?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cbnewbie

If I click a second time the following happens:

Reset this compiler's settings to the defaults?
buttons: OK | Cancel

Cancel -> nothing happens

OK -> The same error (assert) appears again.
buttons: Stop | Continue

Stop -> cb crashes

Continue -> Reset this compiler's settings to the defaults? Are you REALLY sure?
buttons: OK | Cancel

Cancel -> nothing happens

OK -> Auto-detected installation path of of "GNU GCC compiler ""
buttons: OK


oBFusCATed

Is the path correct after you click the final OK button?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

cbnewbie

No. The path is still empty. Maybe there are two problems:

GNU gcc is installed in /etc/alternatives/bin with links in /bin and /usr/bin. Does cb have difficulties to extract the path from the link?

The second problem is that default.conf is not correctly updated or not read properly. The changes I add will be ignored the next time cb starts.

BlueHazzard

Quote from: cbnewbie on April 10, 2017, 09:23:23 PM
GNU gcc is installed in /etc/alternatives/bin with links in /bin and /usr/bin. Does cb have difficulties to extract the path from the link?
does this "alternatives" has some special, non ascii characters?

oBFusCATed

Do you have a compiler (gcc, g++) in /usr/bin?
Can you run codeblocks under strace to see if default.conf is written and if there is any error for the open/read/write/close calls codeblocks is doing?
If  you don't know how to read the strace log, just save it in a file and paste bin it somewhere, so we can take a look.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]