Shop OBEX P1 Docs P2 Docs Learn Events
Need help getting Code:Blocks to work — Parallax Forums

Need help getting Code:Blocks to work

whiteoxewhiteoxe Posts: 794
edited 2014-09-20 13:45 in General Discussion
I had it working on another machine. Code:Blocks is in the Mint software repository. I installed it and wrote a hello world console app. it has an error that it can't find stdio.h

I cant remember what I did last time to get it working , I think i just went to 'SETTINGS' , got confused ,clicked OK. Then it worked. or maybe i download3ed something ?


Build: Debug in mikesTrial (compiler: GNU GCC Compiler)

gcc -Wall -g -march=athlon -Wextra -Wall -ansi -D#include <stdio.h> -D#nclude <stlib.h> -c "/home/doom/Documents/codeblocks programs/mikesTrial/main.c" -o obj/Debug/main.o
/bin/sh: 1: cannot open stdio.h: No such file
Process terminated with status 2 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-09-20 01:20
    Some time ago, I got it in my head that I would use Code:Blocks for everything. But I also had SimpleIDE and Catalina C already working in LInux.

    I never got anywhere.. too many other irons in the fire.

    I simply decided to keep things simple and use what I am sure Parallaxians are keeping up-to-date. If you desire to use Code:Blocks, you may have to provide all the mentoring and maintenance for other Parallaxians.

    The idea is that new software tools generally get accepted by having someone in a sponsorship role. Expecting the old-timers to add to their already busy agendas is awkward at best.
  • Heater.Heater. Posts: 21,230
    edited 2014-09-20 01:52
    whiteox,
    gcc -Wall -g -march=athlon -Wextra -Wall -ansi -D#include <stdio.h> -D#nclude <stlib.h> -c "/home/doom/Documents/codeblocks programs/mikesTrial/main.c" -o obj/Debug/main.o
    
    This is so messed up. How on Earth did you get the "-D#include <stdio.h>" and "-D#nclude <stlib.h>" in there? They will give you the "bash: stdio.h: No such file or directory" error straight away.


    I know nothing about Code::Blocks but I'm guessing there is a dialogue box in there somewhere for setting "defines", Those "-D..." things, and that you have them in there. Remove them.


    If main.c is the only file of this program can you go to a console, change to the directory where that file is and type:
    gcc -Wall -o main main.c
    
    That should at least compile you file, assuming it has no coding errors in it, and produce an executable called main.


    I suggest changing you user name from "doom" to someting more optimistic:)
  • SRLMSRLM Posts: 5,045
    edited 2014-09-20 03:08
    If you create a new C project the default file is a hello world program. If you want to get it to work with PropGCC there's a tutorial: https://sites.google.com/site/propellergcc/documentation/tutorials/code-blocks
  • whiteoxewhiteoxe Posts: 794
    edited 2014-09-20 04:42
    Heater. wrote: »
    whiteox,
    [code]


    I suggest changing you user name from "doom" to someting more optimistic:)

    Ahhh... i just installed from the mint repository and tried to run the hello world , it dsidn't work. I really dont want to care about finding out why at the moment. I have posted on the code:blocks forum. If i get a reponse i might fix it. But Im not going to waste much time on it. I dont have a real need for code:blocks. But it's annoying that i get the error ;-)
  • whiteoxewhiteoxe Posts: 794
    edited 2014-09-20 05:33
    I just switched to Ubuntu. Code:Blocks works fine !

    I haven’t a clue why the trouble in Mint. Myu biggest problem is I'm outta milk and I want a cup of tea at 10:30pm before i hit the sack :)
  • ElectrodudeElectrodude Posts: 1,658
    edited 2014-09-20 13:20
    I can't remember ever getting any of my code to link with any libraries in Code::Blocks. I've switched from that to shell scripts to makefiles - shell scripts and makefiles are simple and I've actually had success with them with getting things to link.

    That's pretty sad if even hello world doesn't work. `gcc helloworld.c -o helloworld` in a terminal should be enough to compile such a trivial program.
    Do you still have your Mint install? In case your Hello World was different, try this one in Codeblocks in a new project with just the default compiler/linker/IDE/etc. settings and see if it works:
    #include <stdio.h>
    
    int main(int argc, char** argv)
    {
        printf("Hello World\n");
    }
    
  • whiteoxewhiteoxe Posts: 794
    edited 2014-09-20 13:45
    Thanks for that electrodude. I will try qand get cdodeblocks working, i might even uninstall and reinstall ? eventually it will work but im not going to hammer away at it just now ;-)

    I'll post when I have the solution ! thanks again, Mike.
Sign In or Register to comment.