Fedora Linux Support Community & Resources Center
  #1  
Old 22nd April 2007, 04:19 PM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Compiling and running an entire poject from command line/terminal on Linux

Hi,

I am Fedora Core 5 32+ bit os. I am a self taught guy and currently trying to get my head around the basics of C++ programming. I am at the moment using the command prompt only, to compile and run the small programs written in C++. Just a while ago I came across this site and something caught my attention, that was nothing else but some really basic interfaces consisting of menus, buttons etc written in C++. So I downloaded some of the code which was in zip format and unzipped the whole thing in a folder. Here is the web page.

http://www.codeguru.com/cpp/controls/menu/

I have attached the screen shot/image (it is from my other machine which has Win xp just to show people here) to this post showing just how many different types of files the unzipped package/source code contains. I am still not used to any particular IDEs on Linux in order to be able to put all these files in one big project. So I was wondering if I keep them all in one folder as they are at the moment on my Linux machine and compile + run them from the command line/terminal itself without using any particular IDEs that work with Linux for example the Eclipse one. Thanks .....
Attached Thumbnails
Click image for larger version

Name:	untitled.JPG
Views:	114
Size:	85.3 KB
ID:	11968  
Reply With Quote
  #2  
Old 22nd April 2007, 09:04 PM
jbannon Offline
Registered User
 
Join Date: Dec 2005
Posts: 909
i can tell you now, you will not get it to compile as it's specific to Windows (stdafx.cpp gives the clue).
__________________
Best regards,
Jim Bannon
(Registered Linux User #405603 :) )
Reply With Quote
  #3  
Old 22nd April 2007, 10:29 PM
Reisswolf's Avatar
Reisswolf Offline
Registered User
 
Join Date: May 2006
Posts: 333
Yep, as jbannon says, in all likelihood the project you have downloaded will not compile in Linux without you making some modifications first.

But in general, yes, if you download a generic, compatible project you should be able to run it from the command line--provided that you supply all the flags correctly.

When you do GUI development in certain IDEs--e.g. Qt development in Designer--you will find that the IDE itself generates files with certain non-standard extensions. These files cannot be read by another IDE. (So you cannot open a .glade file in Designer, nor can you open a .ui file in Glade.) You should be careful about this particular point.

But if the project consists of nothing but generic code, you should be able to compile it from the command line by supplying all the necessary flags.

*****

Eclipse is not a good IDE for C++ development. KDevelop, Anjuta, etc., are built specifically for the purpose; I suggest you use them instead.

But if you are like me, the combination of Emacs (or Geany) and the command line will be the most minimalistic, elegant and preferred solution.
__________________
Registered user # 441814

Last edited by Reisswolf; 22nd April 2007 at 10:34 PM.
Reply With Quote
  #4  
Old 22nd April 2007, 10:41 PM
jbannon Offline
Registered User
 
Join Date: Dec 2005
Posts: 909
If you're going to try Anjuta I suggest you use the version in extras-development as the standard extras one is virtually unusable (I can't even get it to generate and compile the stock examples, it crashes all the time etc). The development version is a considerable improvment. Also make sure that you create an entry for graphviz in /etc/ld.so.conf.d. The file should be called graphviz.conf and it should contain the single line /usr/lib/graphviz. Then run ldconfig -v.
__________________
Best regards,
Jim Bannon
(Registered Linux User #405603 :) )
Reply With Quote
  #5  
Old 12th May 2007, 02:37 PM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Thanks a lot guys..
Reply With Quote
  #6  
Old 12th May 2007, 04:27 PM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,950
I don't think you have realised that codeguru website concentrates only on Visual C/C++, not ANSI C++. You'll only shoot yourself to foot if you are trying to use it as a tutorial/ code example resource.

Some better resources for you:
http://www.cplusplus.com/ and http://www.cprogramming.com/

Also there are few excellent free books to read:
Bruce Eckel's Thinking in C++ vol 1 and 2: http://www.mindview.net/Books/TICPP/...ngInCPP2e.html
C++ In Action Industrial Strength Programming: http://www.relisoft.com/book/index.htm
And How To Think Like A Computer Scientist Learning with C++: http://www.ibiblio.org/obp/thinkCS/cpp/english/

All above deal with ANSI C++ so all examples usually work in both Windows and Linux.

Last edited by pete_1967; 12th May 2007 at 04:34 PM.
Reply With Quote
  #7  
Old 13th May 2007, 01:13 AM
gesho Offline
Registered User
 
Join Date: Sep 2006
Posts: 174
http://www.cppreference.com/index.html

this is another site I've been following along with others above
Reply With Quote
  #8  
Old 13th May 2007, 09:20 AM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Quote:
Originally Posted by pete_1967
I don't think you have realised that codeguru website concentrates only on Visual C/C++, not ANSI C++. You'll only shoot yourself to foot if you are trying to use it as a tutorial/ code example resource.
Thanks. I really appreciate your reply.
Reply With Quote
  #9  
Old 19th February 2009, 03:20 PM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Hello friends,

I have been lately talking to a friend of mine who is also a self taught fellow like me and we have been trying to figure out whether it is possible at all to compile all the different files say written in C++ in a terminal as part of a single project kept in one folder. I am not much familiar with any IDEs on Linux (NetBeans, Eclipse, QT, KDevelop etc.) and I do understand that one should be using them for their efficiency and ease, but I have not any exprience of using them on my own. I read somewhere that in standard C++ one needs to create 'makefiles' (forgive me if I have incorrectly mentioned the term) to connect all the different files that need to talk to each other. Not sure about Java or any other language though. Thanks a lot for your patience and apolozies again for having mistaken Visual C code for standard C++ code earlier. Hope you will excuse my stupidity. Thanks a lot.....cheers.........
Reply With Quote
  #10  
Old 19th February 2009, 03:25 PM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Quote:
Originally Posted by pete_1967 View Post
codeguru website concentrates only on Visual C/C++, not ANSI C++.

Forgive me for the stupidity and sorry that I created an air of confusion with my post. Thanks for the links they are really nice and easy to start with......
Reply With Quote
  #11  
Old 19th February 2009, 03:33 PM
tech291083 Offline
Registered User
 
Join Date: Sep 2006
Posts: 994
Quote:
Originally Posted by Reisswolf View Post
provided that you supply all the flags correctly.

But if the project consists of nothing but generic code, you should be able to compile it from the command line by supplying all the necessary flags.
Thanks a lot for the reply and sorry to say so after a long time.. I do get most of your reply clearly but one thing I am not sure about is 'flags' what are they actually? Sorry but I have not reached programming beyond the basics due to time contraints etc. Thanks a lot again for your time and patience....
Reply With Quote
  #12  
Old 19th February 2009, 04:06 PM
aleph's Avatar
aleph Offline
Banned (for/from) behaving just like everybody else!
 
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307
Quote:
Originally Posted by tech291083 View Post
Thanks a lot for the reply and sorry to say so after a long time.. I do get most of your reply clearly but one thing I am not sure about is 'flags' what are they actually? Sorry but I have not reached programming beyond the basics due to time contraints etc. Thanks a lot again for your time and patience....
Just look at the man pages of GCC. Full explanation of the "flags".

If you find the man page too clumsy, maybe the on-line info pages are better: http://gcc.gnu.org/onlinedocs/gcc-4....l#Invoking-GCC
__________________
I believe in nerditarianism. I read FedoraForum for the Fedora-related posts.
Reply With Quote
Reply

Tags
command, compiling, entire, line or terminal, linux, poject, running

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop Launcher command line from terminal? bg3075 Using Fedora 1 28th June 2009 03:35 PM
Compiling and Running C++ from command line jjesurun Using Fedora 15 28th April 2008 07:43 PM


Current GMT-time: 14:44 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat