Author Topic: When i try to build the code it builds one that i had previously done  (Read 5993 times)

Offline Maynah

  • Single posting newcomer
  • *
  • Posts: 4
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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: When i try to build the code it builds one that i had previously done
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: When i try to build the code it builds one that i had previously done
« Reply #2 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 ?

Offline Maynah

  • Single posting newcomer
  • *
  • Posts: 4
Re: When i try to build the code it builds one that i had previously done
« Reply #3 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.

Offline Maynah

  • Single posting newcomer
  • *
  • Posts: 4
Re: When i try to build the code it builds one that i had previously done
« Reply #4 on: December 12, 2009, 11:58:55 pm »
the file that keeps building is under sources everytime i open a file

Offline Maynah

  • Single posting newcomer
  • *
  • Posts: 4
Re: When i try to build the code it builds one that i had previously done
« Reply #5 on: December 14, 2009, 08:42:17 pm »
any clue how to get this to not show up?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
Re: When i try to build the code it builds one that i had previously done
« Reply #6 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: When i try to build the code it builds one that i had previously done
« Reply #7 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.