Author Topic: Program seems to compile but runs old version  (Read 9364 times)

Offline PREngineer

  • Single posting newcomer
  • *
  • Posts: 4
Program seems to compile but runs old version
« on: February 26, 2017, 06:47:46 pm »
Im having this problem with codeblocks. Lets say i made a program and I compile and run it, than i decide to edit the program from the editor window, but when i try to compile and run the new version, it appears as it has compiled and it runs, but it runs the program i had before editing it. The only solution i have found is to copy the code, close codeblocks and open it again.
This happens periodically
Help?
Thanks!

Offline blauzahn

  • Almost regular
  • **
  • Posts: 155
Re: Program seems to compile but runs old version
« Reply #1 on: February 26, 2017, 07:06:01 pm »
Just to verify: Does your code reside within a project? If it does then when you trigger compilation
 cb will usually save the modified code and call compiler and linker. Is it C/C++? Has the executable
program file been created after you started compilation?

http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

OS? compiler?

Offline PREngineer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program seems to compile but runs old version
« Reply #2 on: February 26, 2017, 07:10:36 pm »
Its a project. Im writing in C and the problem happens when i edit the program and try to recompile it, so there has already been  an executable file created.
the OS is windows 10, updated.
dont know the compiler :/
GNU ?

thanks for your response

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Program seems to compile but runs old version
« Reply #3 on: February 26, 2017, 07:16:20 pm »
Any antivirus-software (avast ?) ?
That is the main-cause for many issues, when creating and overwriting executables on windows.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: Program seems to compile but runs old version
« Reply #4 on: February 26, 2017, 07:18:04 pm »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline PREngineer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program seems to compile but runs old version
« Reply #5 on: February 26, 2017, 07:42:31 pm »
I dont have any antivirus software in my computer, except for windows defender.

Offline PREngineer

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program seems to compile but runs old version
« Reply #6 on: February 26, 2017, 07:46:25 pm »
i just found out that its creating a file called main.c inside the program im creating, and that file main.c has the old code.