Author Topic: Project file hierarchy messing with project compilation  (Read 8332 times)

Offline aluthren

  • Single posting newcomer
  • *
  • Posts: 4
Project file hierarchy messing with project compilation
« on: December 19, 2012, 12:04:16 pm »
So I'm trying to build a project I've been working on, but it seems that the order in which the files are compiled coincides with the file hierarchy in the project management tab. Two files in particular are the main.cpp file and fireworks_class.cpp. Since the files in the management tab are organized alphabetically my project is compiling the fireworks_class.cpp before main.cpp. My question is how can I customize/modify the file hierarchy in the management tab or how to "unlink" the compiling process from the management hierarchy. Or is there something else going on here that I'm not aware of? ???

P.S. I'm using codeblocks 10.05. I know it's an older version, but I only caught wind of codeblocks 12.11 today. I'll install it now, but I highly doubt that will fix my problem. I'll post a reply in a few minutes saying whether or not the new version fixed my issue.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Project file hierarchy messing with project compilation
« Reply #1 on: December 19, 2012, 12:51:58 pm »
Or is there something else going on here that I'm not aware of? ???
The real question is why do you care for the order?
(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 aluthren

  • Single posting newcomer
  • *
  • Posts: 4
Re: Project file hierarchy messing with project compilation
« Reply #2 on: December 19, 2012, 01:05:09 pm »
Well, as I said before, the order in which the compiler compiles my files seems to be related to the order/hierarchy of the files in the management panel. Therefore I must come to the conclusion that the two are somehow connected. re-read the OP for all the details.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Project file hierarchy messing with project compilation
« Reply #3 on: December 19, 2012, 01:19:27 pm »
Still no answer for my qeustion - why do you care?
(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 aluthren

  • Single posting newcomer
  • *
  • Posts: 4
Re: Project file hierarchy messing with project compilation
« Reply #4 on: December 19, 2012, 03:05:45 pm »
If main isn't the first to compile then the project gets errors, therefore I can't run my program. If you have useful information I would really appreciate if you could just post it. Thanks.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Project file hierarchy messing with project compilation
« Reply #5 on: December 19, 2012, 03:31:49 pm »
http://lmgtfy.com/?q=does+compilation+order+matter+in+C%2B%2B

You most likely have other issues. Are you getting compilation or link errors?

Offline aluthren

  • Single posting newcomer
  • *
  • Posts: 4
Re: Project file hierarchy messing with project compilation
« Reply #6 on: December 19, 2012, 03:33:26 pm »
The only errors I'm getting come from the fact that main.cpp isn't being compiled first. I'll look at it again.
« Last Edit: December 19, 2012, 03:35:16 pm by aluthren »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Project file hierarchy messing with project compilation
« Reply #7 on: December 19, 2012, 03:39:27 pm »
What is the error message?

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Project file hierarchy messing with project compilation
« Reply #8 on: December 19, 2012, 11:03:54 pm »
If you right-click on a file, you can change its compile weight under the properties to force it to compile sooner/later.  (Files of the same weight are compiled alphabetically.)
However, as others have already mentioned, the problem is most likely from something else (compile order rarely matters within a target).