User forums > Using Code::Blocks
Lost compiler flags in Build options.
Sagaceil:
Hello,
Recently I notices lack of common compiler flags in build options window :
I know that I can add flags manualy under "Another options" tab, but ability to select a few sets is great ;P
Is there any reason that those options gone ? I'm using latest nightly and I cloned common GCC compiler to be able to select my own folders. What is strange, that the original compiler (build in GNU GCC preset) hasn't those flags too. I'm wondering if the latest nightly changed something in setups of that flags.
Is there any simple solution to restore all that options ? Mayby some config file ?
Thanks, for any help :)
oBFusCATed:
Do you have any options_*.xml files in your %app_data%/codeblocks folder?
Sagaceil:
Yes, there is : AppData\Roaming\CodeBlocks\share\codeblocks\compilers\options_gcc.xml
--- Code: ---<?xml version="1.0" encoding="utf-8"?>
<CodeBlocks_compiler_options>
<Program name="C" value="gcc.exe"/>
<Program name="CPP" value="g++.exe"/>
<Program name="LD" value="g++.exe"/>
<Program name="DBGconfig" value="gdb_debugger:Default"/>
<Program name="LIB" value="ar.exe"/>
<Program name="WINDRES" value="windres.exe"/>
<Program name="MAKE" value="mingw32-make.exe"/>
<Switch name="includeDirs" value="-I"/>
<Switch name="libDirs" value="-L"/>
<Switch name="linkLibs" value="-l"/>
<Switch name="defines" value="-D"/>
<Switch name="genericSwitch" value="-"/>
<Switch name="objectExtension" value="o"/>
<Switch name="forceFwdSlashes" value="false"/>
<Switch name="forceLinkerUseQuotes" value="false"/>
<Switch name="forceCompilerUseQuotes" value="false"/>
<Switch name="needDependencies" value="true"/>
<Switch name="logging" value="default"/>
<Switch name="libPrefix" value="lib"/>
<Switch name="libExtension" value="a"/>
<Switch name="linkerNeedsLibPrefix" value="false"/>
<Switch name="linkerNeedsLibExtension" value="false"/>
<Switch name="linkerNeedsPathResolved" value="false"/>
<Switch name="supportsPCH" value="true"/>
<Switch name="PCHExtension" value="gch"/>
<Switch name="UseFlatObjects" value="false"/>
<Switch name="UseFullSourcePaths" value="true"/>
<Switch name="includeDirSeparator" value=" "/>
<Switch name="libDirSeparator" value=" "/>
<Switch name="objectSeparator" value=" "/>
<Switch name="statusSuccess" value="0"/>
<Switch name="Use83Paths" value="false"/>
<Command name="CompileObject" value="$compiler $options $includes -c $file -o $object"/>
<Command name="CompileObject" value="swig -c++ -lua $includes -o $file_dir/$file_name.cpp $file" ext="i" gen="$file_dir/$file_name.cpp"/>
<Command name="CompileObject" value="ragel $file -C -L -o $file.cpp" ext="rl" gen="$file.cpp"/>
<Command name="CompileObject" value="bison -v -d $file -o $file_dir/$file_name.parser.cc" ext="y" gen="$file_dir/$file_name.parser.cc;$file_dir/$file_name.parser.hh"/>
<Command name="CompileObject" value="flex -o$file_dir/$file_name.scanner.cc $file" ext="l" gen="$file_dir/$file_name.scanner.cc"/>
<Command name="CompileObject" value="cython $file" ext="pyx" gen="$file_dir/$file_name.c"/>
<Command name="CompileObject" value="lzz $includes $file" ext="lzz" gen="$file_dir/$file_name.cpp;$file_dir/$file_name.h"/>
<Command name="GenDependencies" value="$compiler -MM $options -MF $dep_object -MT $object $includes $file"/>
<Command name="CompileResource" value="$rescomp $res_includes -J rc -O coff -i $file -o $resource_output"/>
<Command name="LinkExe" value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -mwindows"/>
<Command name="LinkConsoleExe" value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs"/>
<Command name="LinkDynamic" value="$linker -shared -Wl,--output-def=$def_output -Wl,--out-implib=$static_output -Wl,--dll $libdirs $link_objects $link_resobjects -o $exe_output $link_options $libs"/>
<Command name="LinkStatic" value="cmd /c if exist $static_output del $static_output
$lib_linker -r -s $static_output $link_objects"/>
<Command name="LinkNative" value="$linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs -Wl,--subsystem,native"/>
<RegEx name="Fatal error" type="error" msg="1">
<![CDATA[FATAL:[ \t]*(.*)]]>
</RegEx>
<RegEx name="'In function...' info" type="info" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):[ \t]+([iI]n ([cC]lass|[cC]onstructor|[dD]estructor|[fF]unction|[mM]ember [fF]unction).*)]]>
</RegEx>
<RegEx name="'Skipping N instantiation contexts' info (2)" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t]+(\[[ \t]+[Ss]kipping [0-9]+ instantiation contexts[ \t]+\])]]>
</RegEx>
<RegEx name="'Skipping N instantiation contexts' info" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t]+(\[[ \t]+[Ss]kipping [0-9]+ instantiation contexts[ \t]+\])]]>
</RegEx>
<RegEx name="'In instantiation' warning" type="warning" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):[ \t]+([Ii]n [Ii]nstantiation.*)]]>
</RegEx>
<RegEx name="'Required from' warning" type="warning" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t]+([Rr]equired from.*)]]>
</RegEx>
<RegEx name="'Instantiated from' info (2)" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t]+([Ii]nstantiated from .*)]]>
</RegEx>
<RegEx name="'Instantiated from' info" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t]+([Ii]nstantiated from .*)]]>
</RegEx>
<RegEx name="Resource compiler error" type="error" msg="3" file="1" line="2">
< \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t](.*)]]>
</RegEx>
<RegEx name="Resource compiler error (2)" type="error" msg="1">
<]]>
</RegEx>
<RegEx name="Preprocessor warning" type="warning" msg="4" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):([0-9]+):[ \t]([Ww]arning:[ \t].*)]]>
</RegEx>
<RegEx name="Compiler note (2)" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t]([Nn]ote:[ \t].*)]]>
</RegEx>
<RegEx name="Compiler note" type="info" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t]([Nn]ote:[ \t].*)]]>
</RegEx>
<RegEx name="General note" type="info" msg="1">
<![CDATA[([Nn]ote:[ \t].*)]]>
</RegEx>
<RegEx name="Preprocessor error" type="error" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t](.*)]]>
</RegEx>
<RegEx name="Compiler warning (2)" type="warning" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t]([Ww]arning:[ \t].*)]]>
</RegEx>
<RegEx name="Compiler warning" type="warning" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t]([Ww]arning:[ \t].*)]]>
</RegEx>
<RegEx name="Undefined reference (2)" type="error" msg="3" file="1" line="2">
<![CDATA[[][{}() \t#%$~[:alnum:]&_:+/\.-]+\.o:([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t](undefined reference.*)]]>
</RegEx>
<RegEx name="Compiler error (2)" type="error" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t](.*)]]>
</RegEx>
<RegEx name="Compiler error" type="error" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[ \t](.*)]]>
</RegEx>
<RegEx name="Linker warning" type="warning" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):\(\.text\+[0-9a-fA-FxX]+\):[ \t]([Ww]arning:[ \t].*)]]>
</RegEx>
<RegEx name="Linker error" type="error" msg="3" file="1" line="2">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):([0-9]+):[0-9]+:[ \t](.*)]]>
</RegEx>
<RegEx name="Linker error (2)" type="error" msg="2" file="1">
<![CDATA[[][{}() \t#%$~[:alnum:]&_:+/\.-]+\(.text\+[0-9A-Za-z]+\):([ \tA-Za-z0-9_:+/\.-]+):[ \t](.*)]]>
</RegEx>
<RegEx name="Linker error (3)" type="error" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):\(\.text\+[0-9a-fA-FxX]+\):(.*)]]>
</RegEx>
<RegEx name="Linker error (lib not found)" type="error" msg="2" file="1">
<]]>
</RegEx>
<RegEx name="Linker error (cannot open output file)" type="error" msg="2;3" file="1">
<:[ \t](.*)]]>
</RegEx>
<RegEx name="Linker error (unrecognized option)" type="error" msg="2" file="1">
<]]>
</RegEx>
<RegEx name="Compiler error (unrecognized option)" type="error" msg="1">
<]]>
</RegEx>
<RegEx name="No such file or directory" type="error" msg="2" file="1">
<]]>
</RegEx>
<RegEx name="Undefined reference" type="error" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):[ \t](undefined reference.*)]]>
</RegEx>
<RegEx name="General error" type="error" msg="1">
<![CDATA[([Ee]rror:[ \t].*)]]>
</RegEx>
<RegEx name="General warning" type="warning" msg="1">
<![CDATA[([Ww]arning:[ \t].*)]]>
</RegEx>
<RegEx name="Auto-import info" type="info" msg="1">
<![CDATA[([Ii]nfo:[ \t].*)\(auto-import\)]]>
</RegEx>
<RegEx name="Linker warning (different sized sections)" type="warning" msg="2" file="1">
<![CDATA[([][{}() \t#%$~[:alnum:]&_:+/\.-]+):[ \t]+(duplicate section.*has different size)]]>
</RegEx>
<Sort CFlags="-std=c90 -std=c89 -std=iso9899:1990 -std=iso9899:199409 -std=c99 -std=c9x -std=iso9899:1999 -std=iso9899:199x -std=c11 -std=c1x -std=iso9899:2011 -std=gnu90 -std=gnu89 -std=gnu99 -std=gnu9x -std=gnu11 -std=gnu1x"/>
<Sort CPPFlags="-std=c++98 -std=c++03 -std=gnu++98 -std=gnu++03 -std=c++11 -std=c++0x -std=gnu++11 -std=gnu++0x -std=c++1y -std=gnu++1y -static-libstdc++ -shared-libstdc++ -fpermissive -fdeduce-init-list -fcheck-new -fstrict-enums -Weffc++ -Wctor-dtor-privacy -Wdelete-non-virtual-dtor -Wliteral-suffix -Wc++11-compat -Wnoexcept -Wnon-virtual-dtor -Wreorder -Wstrict-null-sentinel -Wno-non-template-friend -Wnon-template-friend -Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo"/>
</CodeBlocks_compiler_options>
--- End code ---
No more XML's there.
Alpha:
Your XML file was somehow generated without <Option [...] /> entries (??!! - this is a bug, if you can remember/figure out steps to reproduce, please post). Deleting/(re)moving this file (which is a local configuration) will restore the default flag listing.
Sagaceil:
Thanks, deleting this file helped to restore options.
Steps :
Duplicate compiler set (for example GNU GCC to 'copy GNU GCC' ) under Settings -> Compiler window.
Create some project using that 'copy GNU GCC'.
// here I bought new laptop and installed C::B w/o that 'copy GNU GCC' and moved all files of project to new machine. It might be reinstalled and installed C::B, should give the same behavior - delete 'copy GNU..'
Try to open project, go to Build options.
Then I got message, that chosen compiler doesn't exists, so I'm selecting regular GNU GCC. <-- here I lost all options.
These steps to reproduce it are quite rare so most users doesn't even feel that bug ;)
Navigation
[0] Message Index
[#] Next page
Go to full version