PDA

View Full Version : windows guy tryin to learn linux and develop on/for it



cjminton
October 18th, 2009, 10:14 AM
Hi all just need a quick answer for a noob question that I've googled and searched for several times but couldn't find a direct answer.

Using Dev C++ on windows I would write the Hello World program and then I could build it and execute it and a DOS/Console window would pop up saying Hello World.

When I try to write the same exact program in Ubuntu using Code::Blocks or KDevelop or some QT program and others(I've tried several IDEs) it does nothing when I attempt to build it. I don't even think it compiles it or anything. Can .exe files be ran on Ubuntu the same way as in windows where a terminal/DOS-like/console box pops up and says Hello World?

Thank-You.

poisonkiller
October 18th, 2009, 10:22 AM
I use Code::Blocks and it works perfectly.
Try making a new C++ project. It should generate a "Hello World!" application, press F9 to build&compile. If that doesn't work, I have no idea what's wrong.

cjminton
October 18th, 2009, 10:56 AM
Ok I figured it out after you said make a new C++ Project. When I make a new C++ project I have to save the files and manually add .cpp to the end of each file otherwise it won't let me build. I was just selecting new C++ project and then naming it without typing out an extension thinking that it would automatically know how to save the file since I obviously chose C++ project in the first place. Kind of makes me wonder why any of these programs would ask me what kind of program I want but then not even know later especially on multiple IDEs, none of them would build my files LoL...perhaps I should just program with a regular text editor and manually compile and link the files?

Thank you very much for the prompt reply poisonkiller while not giving me exactly what I needed you did remind me to think deeper, this problem has been bothering me for weeks.

Zugzwang
October 19th, 2009, 11:31 AM
cjminton, you *might* want to have a look at the following tutorial (for KDevelop), which contains some explanations and some stuff to get you started in Linux programming without hassle: http://ubuntuforums.org/showthread.php?t=1258665