Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: aluthren 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.
-
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?
-
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.
-
Still no answer for my qeustion - why do you care?
-
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.
-
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?
-
The only errors I'm getting come from the fact that main.cpp isn't being compiled first. I'll look at it again.
-
What is the error message?
-
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).