Author Topic: How to make Code:Blocks remember paths  (Read 4700 times)

Offline stamasd

  • Single posting newcomer
  • *
  • Posts: 6
How to make Code:Blocks remember paths
« on: November 07, 2009, 02:43:59 pm »
I have the following problem. maybe the solution is obvious, but I can't figure it out, and didn't find anything in the wiki or forums related to it. I installed C:B 8.02 with the VC++ 2003 toolkit, the platform SDK from Win XP SP2 and DirectX SDK 9.0.

The problem is that C:B does remember the include and lib paths for the VC++ toolkit, but doesn't remember the include and lib paths for the PSDK and DXSDK. Each time I start C:B up I have to go into settings>compiler and debugger>search directories and manually add the include paths under compiler, and the lib paths under linker. Then I can use the system to compile my stuff. But if I close C:B and start it again, I have again to go and set the paths because it forgets them. It's fairly annoying. I have tried many things, including using "save all" but it still doesn't work. There isn't an option to "save settings" that I could find anywhere.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to make Code:Blocks remember paths
« Reply #1 on: November 07, 2009, 03:19:12 pm »
The settings are normallstored automatically, if C::B is closed.
Make sure, that you close C::B before you shut down your system, because in this case the changed settings can not be saved.

Offline stamasd

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to make Code:Blocks remember paths
« Reply #2 on: November 18, 2009, 09:05:12 pm »
Yes, it happens every time I close C::B and then open it back up. Every path I enter apart from the include and lib directories of the compiler disappear. That includes all the PSDK, directX SDK, etc, everything that I enter manually in the search directories tab.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to make Code:Blocks remember paths
« Reply #3 on: November 18, 2009, 09:24:07 pm »
Yes, it happens every time I close C::B and then open it back up. Every path I enter apart from the include and lib directories of the compiler disappear. That includes all the PSDK, directX SDK, etc, everything that I enter manually in the search directories tab.
First of all: The path's you should better setup at project options level, not compiler level. Otherwise they apply to every project you are working on and are probably not compatible / needed and thus lead to conflicts sooner or later. However, please post a detailed step-by-step instruction what *exactly* you are entering in these options so we can try to reproduce. But there is really not logical reason why this should happen. Alternatively you can try a nightly to see if it applies there, too. Probably this "bug" has already been fixed. However - I am not aware of any modification in that direction. In addition no other user complained about such.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline stamasd

  • Single posting newcomer
  • *
  • Posts: 6
Re: How to make Code:Blocks remember paths
« Reply #4 on: November 19, 2009, 05:32:11 pm »
I am aware this is a weird behavior. I have uninstalled C::B and reinstalled from a fresh download of version 8.02 from sourceforge, then repeated with a download from berlios, and I still see the same behavior.

I *do* want the paths to be set in the general section because I will definitely be using the same PSDK and DirectX SDK for all my projects. No reason to keep multiple SDK versions around.

What I am doing, exactly is:

1. Download C::B

2. Start the C::B install

3. Start C::B after the install is finished

4. Set the default toolkit (in my case, the VC++ toolkit 2003, which is installed at c:\Program Files\Microsoft Visual C++ Toolkit 2003)

5. Settings > compiler and debugger > search directories; under compiler add below the VC++ toolkit path: C:\src\Microsoft Platform SDK for Windows XP SP2\Include and c:\src\directx9\Include
then under Linker I add  C:\src\Microsoft Platform SDK for Windows XP SP2\Lib and c:\src\directx9\Lib
(c:\src\Microsoft Platform SDK for Windows XP SP2 and c:\src\directx9 are the locations of the SDKs)

6. Close C::B

7. Open C::B again

8. The newly added paths are missing.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: How to make Code:Blocks remember paths
« Reply #5 on: November 19, 2009, 07:54:36 pm »
Under Code::Blocks what is the name of the Compiler you are changing?
Edit: IIRC, The 2005/2008 MSVC compiler has weird rules where it sets the values to what it detects at start-up.

NOTE: Did you set the path the the executable bin folder?
If not, always do this first.

Tim S.
« Last Edit: November 19, 2009, 07:56:09 pm by stahta01 »
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How to make Code:Blocks remember paths
« Reply #6 on: November 19, 2009, 09:45:44 pm »
What I am doing, exactly is:
OK - I installed VC2003 toolkit and did exactly what you said. It's working just fine here. No problems. After re-starting everything is still in place an working just fine.

I suggest you try the following:
1.) Try a nightly
2.) (if that does not work) Try removing the configuration file namely "default.conf". C::B configuration files are under %APPDATA%\codeblocks. If unsure, delete the whole folder (make a backup before!!!) Notice that a re-install of C::B is *not* required. We don't do any hocus-pocus that would make a re-install helpful. The installation has nothing to do with the settings except you configured C::B to be "portable". In that case the "default.conf" file (the configuration file with the settings you are referring to) is in your installation path of C::B. If so, remove from there *and* the path above, in case it's there, too. (Notice that the "default.conf" file in the C::B installation directory overrides the other one.)

Surely you can also try step 2.) first. ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ