#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Ireland
    Posts
    26
    Rep Power
    0

    c++ devel in linux


    Im using suse 8.1, but having always used windows, I am finding linux quite frustrating.

    First of all, I cannot seem to compile almost anything, with g++. It does not seem to recognise iostream commands like cout and cin, though it does not throw an error for including <iostream>. Are there librarys I must include when compiling with g++?

    It does compile a simple main fuction that only calls a printf statement. I try to run the compilation with the ./ command but it comes up permission denied. The ./ command seemed to work for me when I was using RedHat 7.1. Is there another command? Or have I some setting that does not let me run files through the console?

    I hope the above has made some sense.

    I look forward to any advise.

    Thanking you in advance,
    Samwise Gamgee
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    Please do not crosspost the same thing in two different forums.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Ireland
    Posts
    26
    Rep Power
    0
    cool. np.
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222

    Re: c++ devel in linux


    Originally posted by gamgee
    It does compile a simple main fuction that only calls a printf statement. I try to run the compilation with the ./ command but it comes up permission denied. The ./ command seemed to work for me when I was using RedHat 7.1. Is there another command? Or have I some setting that does not let me run files through the console?
    A quick, stupid question on that. What are the permissions set to? I'm not sure what the error message would be if the executable permission is not set, but that seems like a first thing to check.

    BTW, I've not yet tried to compile a C++ program under Linux, so I'm not sure what could be wrong with your I/O streams.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    gcc would set the right permissions for the output file. the problem is somewhere else.
    are you on a different filesystem than your /bin (/usr/bin)?

    maybe someone thought it would be a good idea to not allow users to execute any programs that donīt belong to the basis system? - just a guess... or are you running a FAT filesystem for your home directories so you can access it from windows too...

    1000 possible problems...
  10. #6
  11. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,616
    Rep Power
    4247

    Re: c++ devel in linux


    Originally posted by gamgee
    First of all, I cannot seem to compile almost anything, with g++. It does not seem to recognise iostream commands like cout and cin, though it does not throw an error for including <iostream>. Are there librarys I must include when compiling with g++?
    Did you try putting this line somewhere on top under the #includes
    Code:
    using namespace std;
    IIRC, the old g++ (2.95 or so) would compile certain code with or without this line, but a later version (3.xx) would barf, if it wasn't there.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Ireland
    Posts
    26
    Rep Power
    0
    I think you could be on something there Mr. Hirsh. It was on a partition of the fat file system, that was also accessible by windows. I worked around (cheated) what ever the problem was by coping the necessary files, to my home directory, where they run fine.
    Thanks for all the input guys.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    The nameīs Hirsch, sch, not ch. thank you.
    good nite.

    (if you wanna know why i am that bad-mooded, read this: )

    usenet is here

    not related to your post at all! just a general issue here since a few days... please donīt take it as an personal issue

    again, no relation to your thread here. please donīt misunderstand...
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Ireland
    Posts
    26
    Rep Power
    0

    Red face


    Soz about that, I'm not much of a speller, M.Hirsch.
    nn.
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    donīt worry, no problem :)
    (as you can tell, i am in much better shape now after getting the sleep i was missing this week...)

IMN logo majestic logo threadwatch logo seochat tools logo