PDA

View Full Version : [SOLVED] C ide



manudo
September 16th, 2012, 05:18 AM
I have Ubuntu 12.04, I'm new using it so please be patient to explain.

I've installed Ajunta, Eclipse, Code:Blocks, KDevelop, Geany and I run a "Hello World" program and no one work like Windows IDE's.

I run "Hello world!" program in Geany it runs well, but if I run a larger code program it has this error. Note that when I compile, Geany doesn't show me errors.

Here's the code if needed, it's a multiplicator.


#include <stdio.h>

int main()
{
int st, nd, result;

printf("Enter the first number ");
scanf("%d", &st);
printf("Enter the second number ");
scanf("%d", &nd);
result = st * nd;
printf("The result of your multiplication is %d", result);
getchar();
getchar();
}Error in Geany is attached.

Feel free if you want to share a better IDE for C or C++.

Thank you! ;)

MG&TL
September 16th, 2012, 08:38 AM
I've installed Ajunta, Eclipse, Code:Blocks, KDevelop, Geany and I run a "Hello World" program and no one work like Windows IDE's.
Are you expecting them to be? Visual Studio is good, but a complete nightmare if you don't follow its use-case.


I run "Hello world!" program in Geany it runs well, but if I run a larger code program it has this error. Note that when I compile, Geany doesn't show me errors.You're trying to execute the wrong file. Go to the Build->Set build commands and that should help. Although if I recall, both Anjuta and Code::Blocks do this fine. Geany doesn't really seem to be intended as an IDE, more as a text editor with some handy development features, which it does very well.


Feel free if you want to share a better IDE for C or C++.
The ones you've tried are what we have. You probably just need to spend a little time figuring them out, as you no doubt did for the MS IDEs.

safarin
September 16th, 2012, 08:53 AM
#include <stdio.h>

int main()
{
int st, nd, result;

printf("Enter the first number ");
scanf("%d", &st);
printf("Enter the second number ");
scanf("%d", &nd);
result = st * nd;
printf("The result of your multiplication is %d", result);
getchar();
getchar();
}Error in Geany is attached.


The screenshot show you compile using g++ not gcc..
This code is for C or C++ programming??

I compile using geany with no problem.. just got warning because you dont put return 0...

tienlbhoc
September 16th, 2012, 10:52 AM
You can try netbean with c++, but I think you need reinstall compile packages first

manudo
September 16th, 2012, 06:17 PM
You're trying to execute the wrong file. Go to the Build->Set build commands and that should help.

Yeah, but. What I have to do in the Set Build Commands box, I mean, what I have to do right there?

By the way, I'm trying Anjuta.


The screenshot show you compile using g++ not gcc..
This code is for C or C++ programming??

I compile using geany with no problem.. just got warning because you dont put return 0...

Yeah, I don't see a big difference between C and C++, and even if I put return 0; Geany returns that error.

MG&TL
September 16th, 2012, 06:23 PM
Yeah, but. What I have to do in the Set Build Commands box, I mean, what I have to do right there?

By the way, I'm trying Anjuta.

Erm...the command to execute your binary. I don't really know what you're asking, sorry. If you don't know how to build and run executables in Linux, you're probably barking up the wrong tree with an IDE, at least IMO. Learn to manually compile things, then you can use an IDE if you wish.

Anjuta is probably more up your street. It has a more Visual Studio feel, with Projects and whatnot.


Yeah, I don't see a big difference between C and C++, and even if I put return 0; Geany returns that error.

EDIT: Uh-oh. Refer my earlier comment about IDEs- they just complicate things for new developers. My advice is not to use one, and just to use a simple text editor until you get the hang of stuff.

manudo
September 16th, 2012, 07:04 PM
Erm...the command to execute your binary. I don't really know what you're asking, sorry.

Doesn't matter, I've tried Anjuta and finally I understand it. I use terminal to check the executables, but If I double-click it in the explorer it doesn't show me nothing, what's happening?


EDIT: Uh-oh. Refer my earlier comment about IDEs- they just complicate things for new developers. My advice is not to use one, and just to use a simple text editor until you get the hang of stuff.

Yeah, sometimes I use gedit and compile with gcc, but I use IDE's because there are some errors in terminal that I can't understand.

MG&TL
September 16th, 2012, 07:32 PM
Doesn't matter, I've tried Anjuta and finally I understand it. I use terminal to check the executables, but If I double-click it in the explorer it doesn't show me nothing, what's happening?



Yeah, sometimes I use gedit and compile with gcc, but I use IDE's because there are some errors in terminal that I can't understand.

Okay, whatever works for you. :)

For some reason unknown to me, nautilus ("explorer") won't run executables, even if they're graphical. So yeah, it's a terminal job.

My apologies, I kind of assumed you were having basic problems, not IDE problems. :)


Problem with that is that you'll get the exact same errors in an IDE. So I'm not sure what you mean by that.

manudo
September 16th, 2012, 07:43 PM
IDE's tells you where is the expected part, or simply where is the error. It's easier to me.

Thank you by the way! :D

MG&TL
September 16th, 2012, 07:52 PM
IDE's tells you where is the expected part, or simply where is the error. It's easier to me.

Thank you by the way! :D

So does gcc. :P

Not a problem.

manudo
September 16th, 2012, 10:51 PM
It just that I'm used to program with software.