Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: eddyq on March 26, 2013, 10:45:43 pm
-
Where are the settings saved?
-
Depends on your operating system.
-
I use Windows 7 and Linux CentOS.
-
On windows in $APPDATA$\CodeBlocks (ususally c:\Users\[username]\AppData\Roaming\CodeBlocks ), on linux in $HOME/.codeblocks.
The settings are saved in default.conf, if C::B is not called with the -p (--personality,--profile) parameter. In this case it is saved in [personality].conf .
Editting the conf-file manually is not recommended, because it can break the settings and even make C::B crash in some rare cases.
To import and export some parts of the conf-file, you can use cb_share_config[.exe].
If soemthing went totally wrong, you can delete the file and it will be recreated from scratch.
-
Here is what I want to do, maybe someone can offer a solution.
1) I use VirtualBox on Windows and have my Linux in the VirtualBox and I use C::B from that virtual machine
2) I also use C::B for the same project on my Windows system
3) on VB I share the windows folder where the source and project is and I have a symbolic link to that share
This all works fine for the files and the project. But the settings are not shared so when I make a settings change on Windows I have to remember to make that same change on Linux.
One solution would be to tell C::B to keep the settings in the project. That would also solve the problem of checking in the settings into source control.
Eddy
-
Sharing these settings does not really make sense, as the path to the compiler will be incompatible, and it is part of the settings. This really cannot work (even if you make it "work").
-
The settings I need are unique to the project, like include folders, defines, compiler options, etc.
-
The settings I need are unique to the project, like include folders, defines, compiler options, etc.
I think looking at global variables might useful for you.
http://wiki.codeblocks.org/index.php?title=Global_compiler_variables (http://wiki.codeblocks.org/index.php?title=Global_compiler_variables)
I have no idea where Global Variables are saved; but, it might be easier to import/export them using a pre-build script.
I have no direct knowledge that this would be easier that doing import/export of the Compiler Settings. But, I do think it would be safer.
Tim S.
-
The settings I need are unique to the project, like include folders, defines, compiler options, etc.
The per project settings are saved in the appropriate projectfile (*.cbp).
-
>>The per project settings are saved in the appropriate projectfile (*.cbp).
Not fully, for example Settings/Compiler/#defines do not seem to be saved there. I changed it on Linux, closed C::B on Linux, opened it on Windows and the project was not changed. Also Windows did not show a new date on the project.
Then to be sure I'm using the same project on both, I added a function to the Linux side, closed the project and it showed up on the Windows side.
(BTW, how do you quote a post?)
-
Not fully, for example Settings/Compiler/#defines do not seem to be saved there. I changed it on Linux, closed C::B on Linux, opened it on Windows and the project was not changed. Also Windows did not show a new date on the project.
Exact steps to reproduce this, please?
(BTW, how do you quote a post?)
Using the quote link above the post.
-
Not fully, for example Settings/Compiler/#defines do not seem to be saved there. I changed it on Linux, closed C::B on Linux, opened it on Windows and the project was not changed. Also Windows did not show a new date on the project.
Exact steps to reproduce this, please?
1. Use some method of sharing a folder on both Windows and Linux. I use Virtual Box and shared a folder plus added a symbolic link to Linux. Have the project and source files in that link. (obvious but just to be complete).
2. On Linux, select Settings/Compiler/#defines and add something like TEST
3. Close C::B on Linux
4. Open C::B on Windows and select the same project
5. Select Settings/Compiler/#defines and notice that TEST is not there.
-
Not fully, for example Settings/Compiler/#defines do not seem to be saved there. I changed it on Linux, closed C::B on Linux, opened it on Windows and the project was not changed. Also Windows did not show a new date on the project.
Exact steps to reproduce this, please?
1. Use some method of sharing a folder on both Windows and Linux. I use Virtual Box and shared a folder plus added a symbolic link to Linux. Have the project and source files in that link. (obvious but just to be complete).
2. On Linux, select Settings/Compiler/#defines and add something like TEST
3. Close C::B on Linux
4. Open C::B on Windows and select the same project
5. Select Settings/Compiler/#defines and notice that TEST is not there.
They are suggest using the project settings NOT the global compiler setting!
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F)
Tim S.
-
>>The per project settings are saved in the appropriate projectfile (*.cbp).
Not fully, for example Settings/Compiler/#defines do not seem to be saved there. I changed it on Linux, closed C::B on Linux, opened it on Windows and the project was not changed. Also Windows did not show a new date on the project.
Then to be sure I'm using the same project on both, I added a function to the Linux side, closed the project and it showed up on the Windows side.
You should read more exactly !
Per project means per project and not global compiler settings.
There are only a few cases,where it makes sense to touch the global compiler settings, and this will (obviously) be not shareable.
-
Thanks, I only saw "Compiler" under Settings. Reading the link above, I can now see there are the same settings I want if I right click on Project.
Yup, I should have read more carefully.