Author Topic: Where are the settings saved?  (Read 13128 times)

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Where are the settings saved?
« on: March 26, 2013, 10:45:43 pm »
Where are the settings saved?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where are the settings saved?
« Reply #1 on: March 26, 2013, 10:50:54 pm »
Depends on your operating system.

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #2 on: March 26, 2013, 10:57:01 pm »
I use Windows 7 and Linux CentOS.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where are the settings saved?
« Reply #3 on: March 26, 2013, 11:23:51 pm »
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.

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #4 on: March 27, 2013, 02:30:06 pm »
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

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Where are the settings saved?
« Reply #5 on: March 27, 2013, 07:29:18 pm »
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").
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #6 on: April 01, 2013, 02:38:21 pm »
The settings I need are unique to the project, like include folders, defines, compiler options, etc.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Where are the settings saved?
« Reply #7 on: April 01, 2013, 03:15:57 pm »
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

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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where are the settings saved?
« Reply #8 on: April 01, 2013, 05:05:56 pm »
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).

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #9 on: April 03, 2013, 04:47:09 pm »
>>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?)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Where are the settings saved?
« Reply #10 on: April 03, 2013, 05:07:34 pm »
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.
(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!]

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #11 on: April 03, 2013, 05:16:45 pm »
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Where are the settings saved?
« Reply #12 on: April 03, 2013, 05:30:26 pm »
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

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Where are the settings saved?
« Reply #13 on: April 03, 2013, 06:20:34 pm »
>>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.

Offline eddyq

  • Multiple posting newcomer
  • *
  • Posts: 56
Re: Where are the settings saved?
« Reply #14 on: April 03, 2013, 11:01:43 pm »
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.