Author Topic: Newbie here, wanting help, please move my post to correct forum if not allowed  (Read 2652 times)

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Hi. I am a literal noob when it comes to code::blocks so please feel free to move my post elsewhere (tell me where?).
All I want to know is, why is my file not saving when I try and save it. I have a YouTube video here explaining my problem within 90 seconds.

https://www.youtube.com/watch?v=CL7ryEZ3VvA

My code is very basic, it is this

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("There once was a man named Paul\n");
    printf("He was 66 years old\n");
    printf("He really liked the name Paul\n");
    printf("He did not like being 66\n");
    return 0;
}

Yet instead, it brings up my old code and will not save or therefore run, this new one. Can anyone help?

Thank you so much in advance.
Catherine.
CW

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Post a full rebuild log (see this link).

Are you using a local folder (in the video looks like you are using the OneDrive folder)?

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
I am running Code::Blocks version Code::Blocks 20.03 on MyOperatingSystem
Microsoft Windows 11 Home Version 10.0.22621 Build 22621. The compiler I use is GNU GCC Compiler.

When I ... attempt to save the current code I have made and then try to 'Build and Run', it should bring up what I have typed (being 'There once was a man named Paul
He was 66 years old
He really liked the name Paul
He did not being 66'),
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char characterName [] = "Paul";
    int characterAge = 66;
    printf("There once was a man named %s\n", characterName);
    printf("He was 66 years old\n");
    printf("He really liked the name Paul\n");
    printf("He did not like being 66\n");
    return 0;

 but instead it comes up with a triangle shape that I originally created using basic code, instead.

Build log:
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char characterName [] = "Paul";
    int characterAge = 66;
    printf("There once was a man named %s\n", characterName);
    printf("He was 66 years old\n");
    printf("He really liked the name Paul\n");
    printf("He did not like being 66\n");
    return 0;
}


Crash report:
(I am not sure how to find this, as it did not crash on me).

    (Although the following is not necessary, showing that you
     have tried increases the probability of a response.)
I have already tried ...
Saving the file I am currently on and then clicking 'Build and run' but it did not work.
Help please?

I am using a One Drive folder yes, but on windows 11, I don't know how to not use onedrives folders. You'll see in the screenshot I have attempted to save elsewhere (for example on my DOCUMENTS instead of on my desktop this time), but it still saves to OneDrive. I have tried disabling OneDrive but it does not work. Sorry, I really am a newbie.

But any help would be great, thank you.
CW

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Excuse the fact the files are called 'GIRAFFE' etc. by the way, this was me copying a YouTube video which used Giraffe as the file name. TIA.
CW

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Update: I have of course, worked out how to not save to OneDrive. I shouldve known this originally, seeing as I have been working with computers extensively for about 26 years now. Oops. Anyway here is the file path now (see picture please).
CW

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Stop posting images and read carefully the link I gave you. You have not posted the full rebuild log I asked for.

Quote
go to Settings->Compiler and debugger...->Build options (tab) and check Save build log and Always output the full command line)

Then click on "Rebuild" (near the "Build and run" button) and paste the build log here using code tags (the # in the forum editor).

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
'Rebuild' is greyed out... it won't let me click on it...
CW

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Hold on, I went down to the bottom, near all the tabs (such as 'Cccc', 'Build log' 'Build messages' etc.) and got this:


-------------- Build file: "no target" in "no project" (compiler: unknown)---------------

gcc.exe   -c "C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.c" -o "C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.o"
gcc.exe  -o "C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.exe" "C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.o"   
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 
Checking for existence: C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.exe
Executing: '"C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Users\cathe\Documents\Not Onedrive C file GIRAFFE ultimateee.exe"' (in 'C:\Users\cathe\Documents')
Set variable: PATH=C:\Program Files\CodeBlocks\MinGW\bin;C:\Program Files\CodeBlocks\MinGW;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Users\cathe\AppData\Local\Microsoft\WindowsApps
Process terminated with status -1073741510 (0 minute(s), 11 second(s))
 
CW

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Link to how to create a project in CB https://wiki.codeblocks.org/index.php/Creating_a_new_project

FYI: Using spaces in filenames is a good way to make sure you are likely to spend hours trying to fix build issues.

Tim S.
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 caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Thank you Tim, will read that now. Cheers!!  :)
CW

Offline caffycaffy4414

  • Multiple posting newcomer
  • *
  • Posts: 10
Just to let you know Tim, that is for C++, which I am not currently studying at the moment ..... I am trying to study C only.... if you could find me a similar tutorial like this but for C, I would be very grateful.....

Otherwise, thank you anyway :)
CW

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 110
I understand that you have a wonderful troll humor, and you talentedly emphasize all the features as no need to program. All the stars aligned for the giraffe project to be successful. :) ;)
And this is just a masterpiece, why did you replace the text in the logs: for this line, there is no project, there is no compilation target, and the compiler is unknown?
Code
-- Build file: "no target" in "no project" (compiler: unknown)--
« Last Edit: November 28, 2023, 09:54:52 pm by omlk »