Author Topic: compiler issiues  (Read 2152 times)

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
compiler issiues
« on: May 05, 2017, 11:28:31 pm »
I installed Code blocks on my Win 10 laptop and my Mint machine and i am not able to compile on either of the two machines. On my Mint machine i get a Red flag beside "#include <stdio.h> and the debug says "no such file or directory. This happens for both laptops. I have left everything as default and still does not work. I"m just curious if is something i am doing or is it a bug.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler issiues
« Reply #1 on: May 06, 2017, 12:23:58 am »
On the Mint Machine install the "build essential" package.

https://community.linuxmint.com/software/view/build-essential

On the Windows machine install an Compiler.

Edit: If you still have a problem look at this link to report more information http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
« Last Edit: May 06, 2017, 12:26:03 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler issiues
« Reply #2 on: May 06, 2017, 12:29:05 am »
Is the compiler built into the the download from Sourseforge or do i still need to install the compiler.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler issiues
« Reply #3 on: May 06, 2017, 12:58:01 am »
Is the compiler built into the the download from Sourseforge or do i still need to install the compiler.

If the Windows installer had mingw in its filename then a Compiler was part of the installer.

If not, you need to install an Compiler.

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler issiues
« Reply #4 on: May 06, 2017, 01:04:08 am »
I installed the Binary release and the Mingw installer but the compiler still will not work.

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler issiues
« Reply #5 on: May 06, 2017, 01:56:32 am »
This is the error message


 -------------- Build: Debug in sdfa (compiler: GNU GCC Compiler)---------------

gcc -Wall -g -Wmain -pedantic-errors -pedantic -Wzero-as-null-pointer-constant -w -Wfatal-errors -Wextra -ansi -D#include <stdio.h>  -c /home/willaim/Desktop/programming/sdfa/main.c -o obj/Debug/main.o
/bin/sh: 1: cannot open stdio.h: No such file

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12004
    • Travis build status
Re: compiler issiues
« Reply #6 on: May 06, 2017, 01:58:41 am »
Why do you have this -D#include <stdio.h> in the command line?
Include directives are added to your source file, not in the C::B settings!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler issiues
« Reply #7 on: May 06, 2017, 02:02:22 am »
Its not in the command line. All of c program is done in the Code::Blocks IDE.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler issiues
« Reply #8 on: May 06, 2017, 02:33:33 am »
I installed the Binary release and the Mingw installer but the compiler still will not work.

Please state what OS you are talking about in each post; because what I read is you installed MinGW under the Linux OS.
This is NOT a good thing for a newbie to do!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler issiues
« Reply #9 on: May 06, 2017, 02:35:05 am »
Please confirm that you installed the  "build essential" package under the Linux OS!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Willieham

  • Single posting newcomer
  • *
  • Posts: 7
Re: compiler issiues
« Reply #10 on: May 06, 2017, 03:00:56 am »
Sorry for the confusion Tim i appreciate you helping me like this.

I have installed codeblocks 13.12 on to two laptops. The first one is a hp Compaq 6910p which has Linux mint 18 Sarah which i am trying to get codeblocks to work on first as it will be a dedicated laptop for c ,c++, Python and Arduino programming. My main laptop is a HP 15 notebook PC which i am also using but for college.

On my Linux machine i have downloaded any files containing codeblocks including any plug-ins that are in the apps section of the Linux program list. When i could not get codeblocks to work i un-installed it and re-installed codeblocks directly form source-forge.net and i downloaded codeblocks for Linux 64 bit which is what my HP Compaq is but i am getting the same problem occurring. I also followed the link that was posted earlier and downloaded the "build essential" file but it still will not work.

I am sure it is something that i am doing wrong but i just can figure it out. 

On my college laptop it is running Windows 10 and i installed the Mingw Binary release. I followed the installer and kept all the settings default but i am getting an error that states "#include <stdio.h> file does not exist.




Offline stahta01

  • Lives here!
  • ****
  • Posts: 6636
    • My Best Post
Re: compiler issiues
« Reply #11 on: May 06, 2017, 03:22:29 am »
Do you know how to install packages under Linux?

If not, you need to learn how to do that.

Edit: Link that might help you https://community.linuxmint.com/tutorial/view/1525

Tim S.
« Last Edit: May 06, 2017, 04:42:53 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: compiler issiues
« Reply #12 on: May 06, 2017, 09:41:27 am »
It looks like you have added the "#include <stdio.h>" statement to the "# defines" tab in the compiler settings.
Either on project level (Build options of the project or target) or globally in "Settings -> Compiler ...".
This is plain wrong.
Such includes belong into the C/C++-file itself.
Defines are something completely different and can be added inside the source or header files in a line starting with a hash (#), or on the commandline of the compiler (for gcc-compilers prepended with a -D), that's what the happens with statements in the "' defines"-tab.

Now the IDE (Code::Blocks) adds the "#include <stdio.h>" to the commandline when invoking the compiler (prepended with "-D") and that's what happens here.
The commandline defines #include but due to the following space, it tries to find a file named <stdio.h>, what obviously does not exist.

So find the place where you added this line to the tab or start a new project from scratch (with the wizard) and see if it works.
If not, it is set in the global settings, and these settings should not be touched unless you know exactly what you do, because they are used for all projects using this compiler.
An exceptions might be the "Toolchain executables" tab (at least on windows), because you might have to define the correct installation dir of the compiler (and probably the exe-names).