code::blocks build and run error

Need help with C, C++, perl, python, etc?

code::blocks build and run error

Postby reiko » 2015-09-14 17:42

It seems that this project has not been built yet.
Do you want to build it now?

thats the message that i get every time i try to test my program
reiko
 
Posts: 100
Joined: 2015-09-02 22:40

Re: code::blocks build and run error

Postby stevepusser » 2015-09-14 18:44

Not much to go on here...What program? How are you building (compiling) it, then?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8900
Joined: 2009-10-06 05:53

Re: code::blocks build and run error

Postby reiko » 2015-09-14 20:27

stevepusser wrote:Not much to go on here...What program? How are you building (compiling) it, then?

just install code blocks open new console projects and try to run even the hello world program and i get this error
with default settings code blocks ver 13.12
reiko
 
Posts: 100
Joined: 2015-09-02 22:40

Re: code::blocks build and run error

Postby stevepusser » 2015-09-14 20:53

I would guess you are not compiling the example program into an executable binary then. C code just doesn't run as is, it needs that step first.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8900
Joined: 2009-10-06 05:53

Re: build and run error

Postby GarryRicketson » 2015-09-14 21:30

There are some wonderfull "tools" available, they are called "search engines",
Some are better the others. http://startpage.com is one.
You can copy these key words :
code::blocks build and run error
and paste them into the little window, on the search engine page.
Then you get all sorts of results, related to this error message. The search can be narrowed down, if you include some more specfic information, IE:
Using a Debian System , code::blocks build and run error

or perhaps include what "compiler" you are using,
----------------------
These are a couple, I found doing the search for you.
I couldn't do a very good search, because you really have not given enough details at all, just guessing, as to what OS you are using, what compiler, etc,...

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(errors)
http://superuser.com/questions/719021/codeblocks-cant-build-compiler-error
C++ may be some what advanced for you, it might be better if you start with something a little more "basic" first, and there is another topic all ready started here on the forum: That you started, I am not sure why you started another: http://forums.debian.net/viewtopic.php?f=30&t=124596#p592136
I do notice though, this one has been started here in the "Programming" forum, so that is fine,..this is the right place to ask these kind of questions.
----------------------------------------------------------------------------------------------------------
Just a additional note, kind off the topic,but:
I may have mentioned this before, you really should also read these:

Thank you, and please don't take me wrong, I am not trying to "put you down" or anything, we all start out "new" and the learning process is a continues, on going process. My hopes are that you do read carefully the material I am suggesting, and it is of a help to you.
Last edited by GarryRicketson on 2015-09-14 22:17, edited 1 time in total.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4354
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: code::blocks build and run error

Postby GarryRicketson » 2015-09-14 22:14

I do want to apologize, "code::blocks" is the IDE you are using, I kind of missed that,
I am assume you are using the version in the Debian Repositories, on a Debian system ?
Code::Blocks is a cross-platform Integrated Development Environment (IDE).
It is based on a self-developed plugin framework allowing unlimited
extensibility. Most of its functionality is already provided by plugins.
Plugins included in the base package are:
* Compiler frontend to many free compilers
* Debugger frontend for GDB (and CDB for windows platforms)
* Source formatter (based on AStyle)
* Wizard to create new C++ classes
* Code-completion / symbols-browser (work in progress)
* Default MIME handler
* Wizard to create new Code::Blocks plugins
* To-do list
* Extensible wizard based on scripts
* Autosave (saves your work in the unfortunate case of a crash)

I do not know much about this myself, but. Do you also have a compiler installed ?
And this may be of help to you:
http://www.codeblocks.org/user-manual
------------------------------------------------------TIP--------------------------------------------
Also, when one is trying to get help on a program they are trying to make, even if it is just a simple "hello world" program, it is best to include the "script" or code you are trying to use. This must be enclosed in the
Code: Select all
[code] boxes [/code]
or it should be,Example:
This is the code I have, but I can not get it to compile correctly,..
Code: Select all
 #include <iostream>
 
using namespace std;
 
int main
{
    cout << "Hello world!" << endl;
    return 0;
}

This may be of some help too:
http://wiki.codeblocks.org/index.php?title=WxSmith_tutorial:_Hello_world
But honestly, I can not understand, why any one would want to try to write a "hello world" program, using such a complicated method, when they could just do it with a simple bash script, from the command line,..
From: http://linuxcommand.org/wss0010.php
Code: Select all
 #!/bin/bash
# My first script

echo "Hello World!"

the rest of the details are in the above link.
"What we expect you have already Done"

Before doing anything, read the Debian documentation:
Debian Documentation
How to ask the smart way
Debian Foro Español
======================
For the Birds
User avatar
GarryRicketson
 
Posts: 4354
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: code::blocks build and run error

Postby tomazzi » 2015-09-14 23:59

Actually, the 13.12 release in the repositories is the worst one which You can find - this is simply one of the worst versions ever released by the code::bocks team. I'm using code::blocks as my primary IDE, so You can trust me... or maybe not? ;)

The last "stable" and "official" build was a 12.04 (I think) ... I don't remember the exact version number because I'm using nightly builds versions which are just great (at the moment I'm using the "svn build rev 10484 (2015-09-05 12:57:13) gcc 4.7.2 Linux/unicode - 64 bit " - and it works just as it should)

This can be a bit embarrassing, but nightly builds are in fact more stable than the "official, stable builds". This is mainly because the C::B is now switching from the deprecated wxWidgets version 2.8.12 (old stable) to a new v3.x.x

Learn how to compile Autotools projects - in fact, this is really easy - and You'll get the most bleeding edge software "just like that" ;)

Regards.
Odi profanum vulgus
tomazzi
 
Posts: 730
Joined: 2013-08-02 21:33

Re: code::blocks build and run error

Postby マーズ maazu » 2015-09-15 00:55

Me 2. Nightly build is fine for me.

tomazzi wrote:Actually, the 13.12 release in the repositories is the worst one which You can find - this is simply one of the worst versions ever released by the code::bocks team. I'm using code::blocks as my primary IDE, so You can trust me... or maybe not? ;)

The last "stable" and "official" build was a 12.04 (I think) ... I don't remember the exact version number because I'm using nightly builds versions which are just great (at the moment I'm using the "svn build rev 10484 (2015-09-05 12:57:13) gcc 4.7.2 Linux/unicode - 64 bit " - and it works just as it should)

This can be a bit embarrassing, but nightly builds are in fact more stable than the "official, stable builds". This is mainly because the C::B is now switching from the deprecated wxWidgets version 2.8.12 (old stable) to a new v3.x.x

Learn how to compile Autotools projects - in fact, this is really easy - and You'll get the most bleeding edge software "just like that" ;)

Regards.
マーズ maazu
 
Posts: 23
Joined: 2015-05-04 05:13
Location: kuala lumpur

Re: code::blocks build and run error

Postby reiko » 2015-09-15 11:05

i solved this. code::blockes compile C with g++ compiler instead of gcc. g++ is not installed by debian in default so i had
to install the compiler myself apt-get install g++ tnx for the help everybody
reiko
 
Posts: 100
Joined: 2015-09-02 22:40

Re: code::blocks build and run error

Postby tomazzi » 2015-09-15 21:13

Code Blocks build system is using g++ for linking mode, even if the project is purely a C project - this is not essentially a bug, but You should be aware of this .... hmm ... "phenomenon" (this is the way the libtool works, btw). ALWAYS make sure that Your files are compiled with the correct tags: CC or CPP - otherwise unpredictable errors are *very* likely to occur...

Regards.
Odi profanum vulgus
tomazzi
 
Posts: 730
Joined: 2013-08-02 21:33

Re: code::blocks build and run error

Postby runfrodorun » 2015-09-16 21:46

g++ will **almost** compile C code. The main contention is the naming of the include libraries, you would call stdio.h cstdio and so on and so fourth. I believe there are some other minor differences but C++ is /generally/ a superset of C with some extra syntax rules.

-RJ

edit: Found out just an hour ago on a friend's ubuntu image that g++ actually did resolve legacy C include files. So I guess I haven't kept up with the times with default include search paths. Anyway, sorry for the confusion.
Much opinionated.
Some abrasive.
No systemd.
Wow.
runfrodorun
 
Posts: 202
Joined: 2013-06-19 05:09


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable