 |
 |
 |
 |
| Programming & Packaging A place to discuss programming and packaging. |

22nd April 2007, 04:19 PM
|
|
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 .....
|

22nd April 2007, 09:04 PM
|
|
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 :) )
|

22nd April 2007, 10:29 PM
|
 |
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.
|

22nd April 2007, 10:41 PM
|
|
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 :) )
|

12th May 2007, 02:37 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 994

|
|
|
Thanks a lot guys..
|

13th May 2007, 09:20 AM
|
|
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.
|

19th February 2009, 03:20 PM
|
|
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.........
|

19th February 2009, 03:25 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 994

|
|
Quote:
Originally Posted by pete_1967
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......
|

19th February 2009, 03:33 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 994

|
|
Quote:
Originally Posted by Reisswolf
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....
|

19th February 2009, 04:06 PM
|
 |
Banned (for/from) behaving just like everybody else!
|
|
Join Date: Jul 2007
Location: Beijing, China
Posts: 1,307

|
|
Quote:
Originally Posted by tech291083
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.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 14:44 (Wednesday, 19-06-2013)
|
|
 |
 |
 |
 |
|
|