Author Topic: Code::Blocks/compiler? bungling up on first program: Hello, World!  (Read 4451 times)

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Following the subject line, CodeBlocks was generating an error in the window pane at the bottom that shows five tabs for reference.  The build log had its tab open, and the error showing indicated to me, as best as I understood it, that there needed to be a couple of lower level directories below that directory where the project was (the project was named 21Days, from the title of the book I am working from).  I then placed the indicated directories under the project directory.  The two directories were \bin and \Debug.  As as I could tell, that is all that was needed and indicated by the error message.  However, when I tried to run "Hello World", I got an error message in the tab for the Build log.  The error message reads "Linking stage skipped (build target has no object files to link).  Nothing to be done."

This is where I would like some help, please.  How do I get my program to run given this error message, and how do I fix the error?  It really doesn't tell me much as I am a novice user.

Thanks,
theAdmiral

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #1 on: August 10, 2008, 08:24:45 pm »
seems your project setup might be incorrect.

Can you add here in a zip file your project ?

Is your compiler installed correctly ? Which OS ?

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #2 on: August 10, 2008, 08:56:42 pm »
I am sorry about this, but like I said, I am really new to Code::Blocks.  I used to program in Java, and I think there are similarities between the two IDEs.  However, there are also differences.  And at that point, when I notice the differences, is one of the ways that I get stuck.  For example, can't find a feature in CB to compress files.  Is one there?  How would you suggest I send you a compressed file?  Also, in desperation of trying to get the damn thing debugged and working, I am creating objects throughout the 21Days directory that show up in the navigation pane, but only partially show up in the Windows folder, and vice versa.  Could we take it one step at a time?  I see that you are an uberuser.  But this kid is just taking his first steps with Code::Blocks, and recovering from a long hiatus from C++.  Thanks, theAdmiral.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #3 on: August 10, 2008, 09:01:16 pm »
ok :

1) compressing : outside CB --> just zip the project tree

BUT FIRST :

2) how did you create the project ?

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #4 on: August 10, 2008, 09:06:54 pm »
I believe it was File | New | Project | Empty Project.  Beyond that I am unsure.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #5 on: August 10, 2008, 09:17:37 pm »
ok, empty project will require you to manually adjust several thing later on (exe target, or dll, or static lib or ??).

Maybe it is better you start a new project of the type you want.

You want :
 - a console app
 - a dll
 - a static lib
 - a wxwidget executable

?

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #6 on: August 10, 2008, 09:25:55 pm »
I believe I want a console app.  However, I don't know because I don't know what a wxwidget executable is.  Is that for windows xp?  What is that?  I am just trying to create all example programs and exercises that I can find in Sam's Teach Yourself C++ in 21 Days.  Are you familiar with it?

Thanks,
John

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #7 on: August 10, 2008, 09:43:27 pm »
Based on what I see with Code::Blocks capabilities, which I am not saying is much, I cannot develop a hierarchical structure in the navigation pane such that the 21 Days project is broken down into three weeks, and each week is broken down into seven days, and each day contains the practice programs and assignments for that particular day.  Would you agree with this or disagree, Moderator?  If you agree, you are saying that all of my programs will have to go in the Sources folder in the nav pane, and other associated files will have to go in folders designed in Code::Blocks to be specifically for those types of files.  Correct?  Where is some good reading on this so that I can educate myself and not bog you down?  Thanks, theAdmiral.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #8 on: August 10, 2008, 10:04:19 pm »
You most probably will want to use console applications.

From the book you are using, there will be several example programs. You can watch every example program as a project (that's what I would suggest).

So you create a new console project per example program. Now it is up to you where you want to save those projects on your hard disk.

So you can create 21 days directory, with subdirectories as you like.

Note : you could put all example programs as targets of one big project, but I wouldn't do that.So forget I said so ;-)

You can group projects into a workspace.

But just start out with a first example program, and put it somewhere in your directory tree.

So start with file->new->Project : console project and follow the wizard. At the end put in the generated main.cpp your own code.

Offline theAdmiral

  • Single posting newcomer
  • *
  • Posts: 7
Re: Code::Blocks/compiler? bungling up on first program: Hello, World!
« Reply #9 on: August 10, 2008, 11:27:07 pm »
Killerbot,

May I ask some more of your time, please?  I just need to get a few things squared away about your previous response.  I am not sure that you have the book that I have, to look at and see what I am talking about.  For example, throughout each chapter, you are right, there are example programs.  However, your answer did not mention anything about the exercises at the back of each chapter.  Just need to clear up some confusion.    I guess, what I would like to know if there is anyway to organize the console projects under project.  I would also like to know how to make a subdirectory.  That term is not anywhere in the menus that I am working with right now in Code Blocks.  Let me repeat all of this back to you just so I can let you know how I understand it--that for every program, no matter how small, that I create, in order to do that I will have to create a project.  No?  If not, then how can I organize it, please?

Thanks,

theAdmiral
« Last Edit: August 11, 2008, 02:14:10 am by theAdmiral »