Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Jec1201961 on January 18, 2016, 01:10:32 am

Title: Object file not being updated
Post by: Jec1201961 on January 18, 2016, 01:10:32 am
So I install codeblocks

Write the traditional hello world program, compile, build and run it. It works

I make some changes to refresh my C Skills.. Very rusty

//C hello world example
#include <stdio.h>

int main()
{
    char InString[10]="Hello6789";
    int Counter;

    for ( Counter = 0;Counter <= 10; Counter++ )
    {
        printf("Value of Counter is: %d\n", Counter);
    }
  return 0;
}

I get a warning about the unused InString variable..  no big deal.  It compiles, builds and when I run it, it still says Hello World.

The obj and/or exe file are not being updated.

I am not sure why..  any help appreciated
Title: Re: Object file not being updated
Post by: stahta01 on January 18, 2016, 02:19:33 am
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Title: Re: Object file not being updated
Post by: Jec1201961 on January 19, 2016, 12:08:20 am
so I read the link..  here is my build log

mingw32-g++.exe  -o bin\Debug\CleanString.exe obj\Debug\main.o obj\Debug\TestProg.o   
mingw32-g++.exe: error: obj\Debug\main.o: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 1 warning(s) (0 minute(s), 0 second(s))

I understand the main.o is missing but I have no idea how to get it back
Title: Re: Object file not being updated
Post by: BlueHazzard on January 19, 2016, 11:29:06 am
please make a "Build->clean" and then "Build->Build" and repost the log (this steps are exactly described in the FAQ http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F ). In your log, we can only see that the main.o is missing, but not why. If the "Build->clean" is greyed out, you are not using a project.  For that case see this: http://forums.codeblocks.org/index.php/topic,20845.msg142383.html#msg142383

greetings
Title: Re: Object file not being updated
Post by: Jec1201961 on January 20, 2016, 12:41:59 am
Did the Build--> Clean

Log Entries


-------------- Clean: Debug in CleanString (compiler: GNU GCC Compiler)---------------

Cleaned "CleanString - Debug"
Done.

Next I did the Build ---> Build

Log Entries

||=== Build: Debug in CleanString (compiler: GNU GCC Compiler) ===|
||WARNING: Can't read file's timestamp: H:\CodeBlocks Projects\C Stuff\CleanString\main.c|
 obj\Debug\main.o||No such file or directory|
||=== Build failed: 1 error(s), 1 warning(s) (0 minute(s), 1 second(s)) ===|


for info, I am using CodeBlocks Version 13.12 o Windows 7

Title: Re: Object file not being updated
Post by: BlueHazzard on January 20, 2016, 01:11:54 am
Code
||WARNING: Can't read file's timestamp: H:\CodeBlocks Projects\C Stuff\CleanString\main.c|
 obj\Debug\main.o||No such file or directory|

hmm... This means c::b can't read the timestamp of your main.c file. I remeber  that other had the same issue, but i can't remember the solution ;) .
You can try the following:

Ps. For future posts, please post your code and all logs in code tags (the # symbol in the "post reply" editor, or you enter them from hand: "[code ] Here comes your log/ code [/code ]" you have to remove the empty spaces between the []

greetigns
Title: Re: Object file not being updated
Post by: BlueHazzard on January 20, 2016, 01:23:36 am
Ok, i searched a bit the forum and it seems that this problem occurs if the file does not exists anymore on the harddrive, so some more stpes you can try, and please report back if something worked:

i hope this helps
greetings

*interestingly i have a lot less problems with white spaces and special symbols under linux, windows sucks in this place pretty hard, specially if you copy files from windows to linux and vice versa
Title: Re: Object file not being updated
Post by: Jec1201961 on January 20, 2016, 03:05:14 am
Thank you.

The file main.c was missing.

After i ran the plugin "find broken files in project". It gave me the option to remove the broken files. 

I ran Build ---> Clean
The Build ----> Build and voilla, back in business