Having trouble using codeblocks IDE. Quick run through?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Having trouble using codeblocks IDE. Quick run through?
I just recently switched over my main machine to full time linux. One of the things I liked from windows was bloodsheds C++ IDE, I have been trying to get used to codeblocks for Kubuntu instead, but I haven't all figured it out. I just simply want to want to create a simple "hello world" app that I can compile and run from the IDE, so then I can start working on assignments for my intro to structure programming class. Help getting that far would be great, thanks .
I just recently switched over my main machine to full time linux. One of the things I liked from windows was bloodsheds C++ IDE, I have been trying to get used to codeblocks for Kubuntu instead, but I haven't all figured it out. I just simply want to want to create a simple "hello world" app that I can compile and run from the IDE, so then I can start working on assignments for my intro to structure programming class. Help getting that far would be great, thanks .
Why do you need an IDE ?
I.e. why can't you for starters use plain gcc/g++ ?
I'm using CodeBlocks a little in both Linux and Windows. In Linux I did have some initial problems because practical use of CodeBlocks depends on some other packages that are not identified as dependencies, so Synaptic (the package manager I use) did not install them.
Unfortunately I didn't record the details anywhere.
CodeBlocks UI is fairly obvious, so I think it is not so likely that you don't understand how to use it and more likely that you haven't installed some of the other software packages you need in order to use it.
If you are trying something that looks like it ought to work but doesn't, it probably should. Describe what you did and what went wrong and hopefully someone can guess what software is missing.
If you know what is missing, then it is trivial in Synaptic to install it.
Obviously you need to install the compiler and associated headers and libraries for software development in C++. CodeBlocks installation rightly does not assume your chosen language is C++.
Ubuntu has a package called build-essential that brings in several of the most important packages needed for building other software. So make sure you have that installed before even asking what else might be missing.
There are also basic tools for auto generating makefiles that I think CodeBlocks always needs but that also are not installed automatically when you install CodeBlocks.
Quote:
Originally Posted by Sergei Steshenko
Why do you need an IDE ?
I.e. why can't you for starters use plain gcc/g++ ?
Quote:
Originally Posted by Sergei Steshenko
So, how are you going to debug a real time program or an OS kernel ?
I expect you've noticed in other threads that I don't believe in routinely answering the question the OP asked. If I am fairly sure the OP is going down the wrong path and should be doing something different and or asking a different question to address his real problem, I'm always in favor of a useful reply (which is often a question back at the OP) rather than a direct answer to the literal question.
So if you really believe an IDE isn't a valid path for the OP, your replies could have constructive intent. But even if you and many others never want to use an IDE, it is very hard to argue that it isn't a valid choice for those who want to.
I expect the OP would appreciate cutting off the discussion here about whether to use an IDE and continuing this thread only on how to use an IDE.
I'm using CodeBlocks a little in both Linux and Windows. In Linux I did have some initial problems because practical use of CodeBlocks depends on some other packages that are not identified as dependencies, so Synaptic (the package manager I use) did not install them.
Unfortunately I didn't record the details anywhere.
CodeBlocks UI is fairly obvious, so I think it is not so likely that you don't understand how to use it and more likely that you haven't installed some of the other software packages you need in order to use it.
If you are trying something that looks like it ought to work but doesn't, it probably should. Describe what you did and what went wrong and hopefully someone can guess what software is missing.
If you know what is missing, then it is trivial in Synaptic to install it.
Obviously you need to install the compiler and associated headers and libraries for software development in C++. CodeBlocks installation rightly does not assume your chosen language is C++.
Ubuntu has a package called build-essential that brings in several of the most important packages needed for building other software. So make sure you have that installed before even asking what else might be missing.
There are also basic tools for auto generating makefiles that I think CodeBlocks always needs but that also are not installed automatically when you install CodeBlocks.
I expect you've noticed in other threads that I don't believe in routinely answering the question the OP asked. If I am fairly sure the OP is going down the wrong path and should be doing something different and or asking a different question to address his real problem, I'm always in favor of a useful reply (which is often a question back at the OP) rather than a direct answer to the literal question.
So if you really believe an IDE isn't a valid path for the OP, your replies could have constructive intent. But even if you and many others never want to use an IDE, it is very hard to argue that it isn't a valid choice for those who want to.
I expect the OP would appreciate cutting off the discussion here about whether to use an IDE and continuing this thread only on how to use an IDE.
Thank you, your reply is much appreciated. My needs are really pretty simple, I just want to create console applications, compile, and run them. I need to be able to link with .obj files, and I need the compiler to be able to direct me to the line of code that an error exists. I am not doing anything OS specific, just C++, so I really only need functionality.
I try and start a new console projects, using only the namspace std and iomanip class, and when I hit the button to compile and run nothing seems to happen.
Last edited by mothergoose729; 04-10-2010 at 02:31 PM.
Linux uses .o files for the same purpose that Windows uses .obj files. The format is different, so you can't use Windows .obj files when building a Linux program.
Quote:
I try and start a new console projects, using only the namspace std and iomanip class
When I start a new console app in CodeBlocks, selecting C++, it creates main.cpp for me containing the usual Hello world program. There is a Projects tab on the left, where I can open the Sources subtree then click on (opening) main.cpp and see the Hellow world program it created. Does that much work for you?
Quote:
when I hit the button to compile and run nothing seems to happen.
Did you install that build-essential package I mentioned above?
I also have autoconf and automake installed in my system. I got a failure similar to what you describe while testing some IDE quite a while ago and got past it be installing those two packages and a few other (probably it only needed automake). I don't think that IDE was CodeBlocks, but it might have been.
Also, in synaptic find and click on codeblocks, then click on the Dependencies tab, and look at the items that say Suggests or Recommends. Those are other packages needed for various features of CodeBlocks. You ought to look at the description of each of those in Synaptic to see whether you want to install it.
Thanks, I am going to play with it a bit more and post back if I have problems. Is there a way to convert .obj files to .o, or might it be possible to run them or another IDE with WINE?
Is there a way to convert .obj files to .o, or might it be possible to run them or another IDE with WINE?
What are those .obj file and why do you need to use them (rather than source code)?
Also, are you using 32 bit or 64 bit kubuntu? And are those 32 bit or 64 bit Windows .obj files?
I expect you could install a 32 bit Windows CodeBlocks plus Mingw into 32 or 64 bit kubuntu within wine and develop and test 32 bit Windows programs in kubuntu. I don't think it would be easy. But I don't think there would be any really serious problem.
I don't know the level of support for 64 bit Windows, so I don't know whether 64 bit Windows programming in Windows codeblocks in wine would be flat out impossible or merely harder to set up than 32 bit.
I don't have much VM experience, but if you want to work on Windows programs in an IDE in Linux, you'll see a lot more people ahead of you able to guide the way if you use a VM rather than wine.
For the alternate approach, I'm not sure any conversion of .obj to .o to link Windows .obj files into Linux programs would be practical. But there as well, I do understand several reasons why however hard it might be in 32 bit, it would be even harder in 64 bit.
What are those .obj file and why do you need to use them (rather than source code)?
Also, are you using 32 bit or 64 bit kubuntu? And are those 32 bit or 64 bit Windows .obj files?
I expect you could install a 32 bit Windows CodeBlocks plus Mingw into 32 or 64 bit kubuntu within wine and develop and test 32 bit Windows programs in kubuntu. I don't think it would be easy. But I don't think there would be any really serious problem.
I don't know the level of support for 64 bit Windows, so I don't know whether 64 bit Windows programming in Windows codeblocks in wine would be flat out impossible or merely harder to set up than 32 bit.
I don't have much VM experience, but if you want to work on Windows programs in an IDE in Linux, you'll see a lot more people ahead of you able to guide the way if you use a VM rather than wine.
For the alternate approach, I'm not sure any conversion of .obj to .o to link Windows .obj files into Linux programs would be practical. But there as well, I do understand several reasons why however hard it might be in 32 bit, it would be even harder in 64 bit.
These .obj files are used by my professor to seed and check the functions we right. We have been using devshed C++ and using the linker options to run them in place of a main file. This lets him keep the contents secret and test our programs. It won't be possible to do my homework in the class without the ability to run them. AFAIK none of them are OS specific. Some of the require reading .txt files, but that can be easily emulated with wine so I am not worried.
Might the simplest thing to do be to install devshed IDE and then use my programs with wine directories?
I had to take a lot of time off for other things, but I recently got back into trying to get codeblocks working. I am now able to build and compile projects within code blocks using the GNC compiler. When I try and run them though i get this error from the console:
Code:
sh: home/me/C++projects/test/untitled2: Permission denied
press ENTER to continue..
I had to take a lot of time off for other things, but I recently got back into trying to get codeblocks working. I am now able to build and compile projects within code blocks using the GNC compiler. When I try and run them though i get this error from the console:
Code:
sh: home/me/C++projects/test/untitled2: Permission denied
press ENTER to continue..
me@LinuxPC:~$ cd '/home/me/C++ projects/test'
me@LinuxPC:~/C++ projects/test$ ls -lt
total 16
-rw-r--r-- 1 me me 84 2010-05-19 14:52 Untitled2
-rw-r--r-- 1 me me 240 2010-05-19 14:49 test.layout
-rw-r--r-- 1 me me 92 2010-05-19 14:48 Untitled1
-rw-r--r-- 1 me me 1033 2010-05-19 14:47 test.cbp
I am not an expert on shell prompt, but don't the rw and r flags mean read and write?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.