Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Maynah on December 12, 2009, 09:59:27 pm

Title: When i try to build the code it builds one that i had previously done
Post by: Maynah on December 12, 2009, 09:59:27 pm
I'm using MinGW for a compiler and whenever i open a file to build it always builds a project that i had previously done, it does it to every code i try to build and i cant figure out how to get it to not show up on every project i do.
Title: Re: When i try to build the code it builds one that i had previously done
Post by: stahta01 on December 12, 2009, 10:33:05 pm
Build or Re-Build?

If just Re-Build does it; look for a project dependency setting.

If both the likely, you have a issue with you file time/system clock.

Tim S.
Title: Re: When i try to build the code it builds one that i had previously done
Post by: Jenna on December 12, 2009, 10:36:52 pm
I'm using MinGW for a compiler and whenever i open a file to build it always builds a project that i had previously done, it does it to every code i try to build and i cant figure out how to get it to not show up on every project i do.

Can you please describe exactly what you do ?

Do you try to build a single file or a project ?
If it's asingle file, do you have a project opened or just the file ?
If it's a project, do you have one or multiple projects open at the same time ?
Title: Re: When i try to build the code it builds one that i had previously done
Post by: Maynah on December 12, 2009, 11:56:14 pm
I'm opening a new project and then i open my file into CB and im building not re building. when i build it it says there are no errors but when i run it its running a different file (main.cpp) ive tried to go through and delete this but it still runs it.
Title: Re: When i try to build the code it builds one that i had previously done
Post by: Maynah on December 12, 2009, 11:58:55 pm
the file that keeps building is under sources everytime i open a file
Title: Re: When i try to build the code it builds one that i had previously done
Post by: Maynah on December 14, 2009, 08:42:17 pm
any clue how to get this to not show up?
Title: Re: When i try to build the code it builds one that i had previously done
Post by: stahta01 on December 15, 2009, 01:06:13 am
No clue what is wrong.

Suggest turning on full compiler log

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S.
Title: Re: When i try to build the code it builds one that i had previously done
Post by: Jenna on December 15, 2009, 01:55:40 am
Do I understand correctly, that you have a project open, that has main.cpp under sources in the manager pane ?

Then you open another source file and click on build or build and run ?

If you do so, that can not work, because the toolbar-buttons work woth the active project, not with single files that does not belong to a project.

In this case you can either close the project and open the file or (better and the only simple way to use the debugger in gdb) add the file to a(n empty) project, to be sure to build and run the correct sources.

Single files can only be build from the menu or with keyboard-shortcut (strg+shift+f9).

If a project (or most likely the default workspace) always opens on C::B startup, you can try to check "Settings -> Environment... -> General settings -> On application start-up -> Open blank workspace".

A look into the documentation might also be helpful: http://www.codeblocks.org/user-manual (http://www.codeblocks.org/user-manual).