openSUSE Forums > Programming/Scripting » Question on C++ compiling

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-Sep-2009, 14:16
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Question on C++ compiling

Hi all!

I am taking a C++ programming class and I have an assignment due today ... Anyways I have the program done and I am trying to build it so I know if it will work and my system (running openSUSE 11.1, AMD Athlon 64 x2, 3 Gig RAM, 2 Gig swap) slows down to a craw, it has been like this for about 30 minutes now. The scary thing is I can take the same code and build it on my PowerBook G4 with Xcode and Apples version of GCC and it sucessfully builds in <4 seconds with a i386 and ppc binary.

The code is not anything complex or anything because this is an introduction class, anyways here is the code

Code:
#include <iostream>
#include <string>

using namespace std;

int main () {
    string row1;
	string row2;
	string row3; //Create three seperate strings for use latter
	
	//store the first bit of data into the first variable "row1"
	row1= "I saw the big brown bear.";
	//store the second bit of data into the second variable "row2"
	row2= "The big brown bear saw me.";
	//store the third bit of fdata into the third variable "row3"
	row3= "Oh!  What a frightening experience!";
	
	//Take the above veriables and use them to print out the three lines
	cout<<row1<<endl;
	cout<<row2<<endl;
	cout<<row3<<endl;
	//If all goes well return with 0 for no error
    return 0;
}
The IDE that I am using is Kdevelop 3, tried 4 but it seems to still be lacking features and can't figure out the new UI

I'm going to go ahead and submit this because it compiles on my Mac with no errors, but if anyone has any ideas as to what I need to look for to get this to compile on my Linux box that would be great.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #2 (permalink)  
Old 11-Sep-2009, 15:08
Explorer Penguin
 
Join Date: Mar 2009
Location: London
Posts: 118
Barry_Nichols hasn't been rated much yet
Default Re: Question on C++ compiling

What command did you use to compile?
Reply With Quote
  #3 (permalink)  
Old 11-Sep-2009, 15:27
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Re: Question on C++ compiling

I just used the build command in Kdevelop I don't know the actual command that was used.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #4 (permalink)  
Old 11-Sep-2009, 16:15
Explorer Penguin
 
Join Date: Oct 2008
Posts: 156
LewsTherinTelemon hasn't been rated much yet
Send a message via AIM to LewsTherinTelemon
Post Re: Question on C++ compiling

I personally have not used Kdevelop, so can't offer much advice there - but I would go ahead and compile with gcc (g++) on the command line and see what happens, it may well just be with Kdevelop. If that is the case, and you are interested, you might want to check out Eclipse.

Lews Therin
Reply With Quote
  #5 (permalink)  
Old 11-Sep-2009, 18:40
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Re: Question on C++ compiling

Compiling with just gcc works fine so the problem has to be with Kdevelop somewhere.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #6 (permalink)  
Old 11-Sep-2009, 22:10
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Re: Question on C++ compiling

If it helps I found out what Kdevelop is running when building the program:

Quote:
cd '/home/vendion/bin/ProgrammingClass/assignment1/debug/src' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" LC_MESSAGES="C" LC_CTYPE="C" gmake assignment1.lo
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I/home/vendion/bin/ProgrammingClass/assignment1/src -I.. -O0 -g3 -MT assignment1.lo -MD -MP -MF .deps/assignment1.Tpo -c -o assignment1.lo /home/vendion/bin/ProgrammingClass/assignment1/src/assignment1.cpp
I am unable to make sense of this, but maybe someone here (also posted my question in Kdevelop's forums) can.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #7 (permalink)  
Old 12-Sep-2009, 22:04
Explorer Penguin
 
Join Date: Mar 2009
Location: London
Posts: 118
Barry_Nichols hasn't been rated much yet
Default Re: Question on C++ compiling

Hi,

Unfortunately I can't offer any help with Kdevelop, as I have never used it.

I would recommend using gcc. I don't use anything but gcc to compile c++ programs, I use Emacs to code them, which I would also highly recommend, as it provides so many keyboard shortcuts and syntax highlighting, which it also provides for Java, HTML, PHP, SQL, Perl... pretty much every programming/scripting language I have used.

Anyway, good luck with your programming lessons, feel free to contact me to discuss programming/C++.

Regards,
Barry.
Reply With Quote
  #8 (permalink)  
Old 13-Sep-2009, 10:17
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Re: Question on C++ compiling

I prefer vi/vim over emacs because the vi commands just feel more natural to me. Yes I did give emacs a try when I converted to Linux and was looking for a text editor, but when I found out about vi I was amazed at how easy it was. Also vi does syntax highlighting so that is covered as well.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #9 (permalink)  
Old 14-Sep-2009, 05:43
vendion's Avatar
Busy Penguin
 
Join Date: Jun 2008
Location: Cleveland, TN USA
Posts: 384
vendion hasn't been rated much yet
Send a message via ICQ to vendion Send a message via AIM to vendion Send a message via MSN to vendion Send a message via Yahoo to vendion
Default Re: Question on C++ compiling

Turns out KDevelop 3.5.x is doomed to never to work with openSUSE 11.1 because it requires libtool 1.5 but the one in the repos is 2.2.6.
__________________
"We must plan for freedom, and not only for security, if for no other reason than only freedom can make security more secure." Karl Popper
Reply With Quote
  #10 (permalink)  
Old 17-Sep-2009, 18:27
Puzzled Penguin
 
Join Date: Jan 2009
Location: Nürnberg
Posts: 17
alerich hasn't been rated much yet
Default Re: Question on C++ compiling

The problem with Kdevelop 3 is that no s actively working on it, but Kdevelop 4 is just not stable enough. Until Kdevelop4 is stable enough, I'd recommend using Eclipse or QtCreator if you want something simpler.
Unfortunately I don't know anything about libtool, so I can't help you in finding out the problem with that command.
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks


Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2