News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

When i try to build the code it builds one that i had previously done

Started by Maynah, December 12, 2009, 09:59:27 PM

Previous topic - Next topic

Maynah

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.

stahta01

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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

Quote from: 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.

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 ?

Maynah

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.

Maynah

the file that keeps building is under sources everytime i open a file

Maynah


stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

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.