Author Topic: Header/Source switching works one way only  (Read 5009 times)

Offline ShureG

  • Single posting newcomer
  • *
  • Posts: 6
Header/Source switching works one way only
« on: March 13, 2009, 05:00:24 pm »
Hi

I am using C::B on a project with an external makefile and the directory structure in which the source files are kept separate from the header files. (The .cc source files are under lib/c++/... and the .h headers are under include/c++/... ). The weird thing is that header/source switching only seems to work one way, i.e.
when I am in lib/c++/somedir/something.cc, F11 takes me to include/c++/somedir/something.h with no problems, but the reverse does not work - C::B asks me if I want to create a source file every time I try to go from header to (existing) source. Any ideas?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Header/Source switching works one way only
« Reply #1 on: March 13, 2009, 05:11:18 pm »
You forget to state the os and the codeblocks version. :D.
I have not meet this problem from header file to implement file and vice versa.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ShureG

  • Single posting newcomer
  • *
  • Posts: 6
Re: Header/Source switching works one way only
« Reply #2 on: March 13, 2009, 05:18:47 pm »
Yes, sorry about that:

OS: Ubuntu 8.04 (Hardy Heron)
C::B Version: 8.02

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Header/Source switching works one way only
« Reply #3 on: March 13, 2009, 05:23:15 pm »
I'm using windows.
Why not try a nightly build version? :D
It has many bug fixed from 8.02
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ShureG

  • Single posting newcomer
  • *
  • Posts: 6
Re: Header/Source switching works one way only
« Reply #4 on: March 13, 2009, 05:23:59 pm »
I don't have a lot of experience with nightly builds and instructions are not clear on how to use them under Linux
« Last Edit: March 13, 2009, 05:29:07 pm by ShureG »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Header/Source switching works one way only
« Reply #5 on: March 13, 2009, 05:29:15 pm »
Are the header and source files both included in the project ?

Offline ShureG

  • Single posting newcomer
  • *
  • Posts: 6
Re: Header/Source switching works one way only
« Reply #6 on: March 13, 2009, 05:29:45 pm »
Are the header and source files both included in the project ?

Yes they are

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Header/Source switching works one way only
« Reply #7 on: March 13, 2009, 05:36:30 pm »
I don't have a lot of experience with nightly builds and instructions are not clear on how to use them under Linux

If you want to give them a try, you can use my repo (see signature for how to do this).

If you have C::B 8.02 installed from .deb-files an update should work without problems, if not you should uninstall it before.

Offline ShureG

  • Single posting newcomer
  • *
  • Posts: 6
Re: Header/Source switching works one way only
« Reply #8 on: March 13, 2009, 05:47:44 pm »
I don't have a lot of experience with nightly builds and instructions are not clear on how to use them under Linux

If you want to give them a try, you can use my repo (see signature for how to do this).

If you have C::B 8.02 installed from .deb-files an update should work without problems, if not you should uninstall it before.

OK, thanks, I'll give it a go