Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Question on C++ compiling

  1. #1
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    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

  2. #2
    Join Date
    Mar 2009
    Location
    London
    Posts
    426

    Default Re: Question on C++ compiling

    What command did you use to compile?

  3. #3
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    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

  4. #4

    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

  5. #5
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    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

  6. #6
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    Default Re: Question on C++ compiling

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

    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

  7. #7
    Join Date
    Mar 2009
    Location
    London
    Posts
    426

    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.

  8. #8
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    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

  9. #9
    Join Date
    Jun 2008
    Location
    Cleveland, TN USA
    Posts
    412

    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

  10. #10
    Join Date
    Jan 2009
    Location
    Nrnberg
    Posts
    19

    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •