Author Topic: Problem with "iostream"/"iostream.h"  (Read 10736 times)

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
Problem with "iostream"/"iostream.h"
« on: April 24, 2008, 03:13:02 PM »
I use a simple program (Yes, it's "Hello World");

#include <iostream>

int main()
{
    std::cout << "Hello, world!\n";
    return 0;
}

but all I got was a lousy "iostream: No such file or directory"

I then tried;

#include <iostream.h> 

int main()
{
    std::cout << "Hello, world!\n";
    return 0;
}

But then I got this huge error log given below. Does anyone know what this could be? (Not as a discussion about wether I should use iostream or iostream.h with the latter being the old way of typing it etc., but rather about the actual problem since neither of them work). I use Visual SlickEdit v.9.0.2.

Thankful for any ideas  :)


Part of the Huge Error log;

---------- Build Project: 'HelloProject.vpj' - 'Debug' ---------- VSLICKERRORPATH="c:\vslick\win\HelloProject"
HelloProject.cpp
Linking...
/sde4/sde/bin/ld.exe: warning: cannot find entry symbol __start; defaulting to 80020000
/sde4/sde\lib/libstdc++.a(iostream.o): In function `skip_ws(streambuf *)':
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x128): undefined reference to `_ctype'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x12c): undefined reference to `_ctype'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `istream::operator>>(char *)':
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x9d4): undefined reference to `_ctype'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x9d8): undefined reference to `_ctype'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `write_int(ostream &, unsigned long long, int)':
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x1954): undefined reference to `__umoddi3'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x1974): undefined reference to `__udivdi3'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `ostream::operator<<(char const *)':
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x231c): undefined reference to `strlen'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `ostream::do_osfx(void)':
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x2c34): undefined reference to `_iob'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x2c38): undefined reference to `_iob'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x2c3c): undefined reference to `fflush'
/vol/sde/release4.0/src/egcs/libio/iostream.cc(.text+0x2c44): undefined reference to `fflush'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `_IO_ostream_withassign type_info function':
/vol/sde/release4.0/src/egcs/libio/iostream.h(.text+0x2f84): undefined reference to `__rtti_class'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `_IO_ostream_withassign::~_IO_ostream_withassign(void)':
/vol/sde/release4.0/src/egcs/libio/iostream.h(.text+0x304c): undefined reference to `__builtin_delete'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `_IO_istream_withassign type_info function':
/vol/sde/release4.0/src/egcs/libio/iostream.h(.text+0x30c0): undefined reference to `__rtti_class'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `_IO_istream_withassign::~_IO_istream_withassign(void)':
/vol/sde/release4.0/src/egcs/libio/iostream.h(.text+0x3188): undefined reference to `__builtin_delete'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `iostream type_info function':
/vol/sde/release4.0/src/egcs/libio/iostream.h(.text+0x3364): undefined reference to `__rtti_class'
/sde4/sde\lib/libstdc++.a(iostream.o): In function `iostream::~iostream(void)':
.
.
.
/sde4/sde\lib/libstdc++.a(stdiostream.o): In function `stdiobuf type_info function':
/vol/sde/release4.0/src/egcs/libio/stdiostream.h(.text+0xb18): undefined reference to `__rtti_si'
*** Errors occurred during this build ***
« Last Edit: April 24, 2008, 03:26:14 PM by Knarkargott »

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Problem with "iostream"/"iostream.h"
« Reply #1 on: April 24, 2008, 11:06:23 PM »
I've never used the auto-generated auto-maintained build system, nor EGCS, however the help file says that to build outside of slickedit, you can use 
make -f Makefile CFG=ConfigName

I suggest you try to get it building outside of slickedit first.  If you get errors, you could capture the actual compile and link commands and ask on a GCC forum.  If it builds ok outside of slickedit, then you might need to experiment with the compiler/linker options in the project properties dialog.  Did you use Slickedit's GNU/C++ wizard to create the project?

Graeme

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Problem with "iostream"/"iostream.h"
« Reply #2 on: April 25, 2008, 08:14:28 AM »
I've never used the auto-generated auto-maintained build system, nor EGCS, however the help file says that to build outside of slickedit, you can use 
make -f Makefile CFG=ConfigName
I tried this, but with the same result   :(

I suggest you try to get it building outside of slickedit first.  If you get errors, you could capture the actual compile and link commands and ask on a GCC forum.  If it builds ok outside of slickedit, then you might need to experiment with the compiler/linker options in the project properties dialog. 
I will try on a GCC forum to see if anyone can help me out.

Did you use Slickedit's GNU/C++ wizard to create the project?
Yes, I did. Is this good or bad or just for information?
« Last Edit: April 25, 2008, 09:00:48 AM by Knarkargott »

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Problem with "iostream"/"iostream.h"
« Reply #3 on: April 25, 2008, 08:52:22 AM »
I got a bit further by creating a new project and not using the GNU c/C++ Wizard, but Windows 32bit...

I now got "Nothing to be done for `all'."
To me it seems like it's not an error message, but rather information that nothing should be done. But I would have expected something to happen  :-\

(This is probably off the topic of this thread, so I will start a new one if I can't find a solution to this problem)


Message when I Build;
------------------------------
C:\vslick\win\HelloProject>c: & cd c:\vslick\win\HelloProject

C:\vslick\win\HejProject>echo VSLICKERRORPATH="c:\vslick\win\HelloProject"
VSLICKERRORPATH="c:\vslick\win\HelloProject"

C:\vslick\win\HelloProject>make -f "HelloProject.mak" CFG=Debug
make: Nothing to be done for `all'.
------------------------------
« Last Edit: April 25, 2008, 08:59:42 AM by Knarkargott »

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Problem with "iostream"/"iostream.h"
« Reply #4 on: April 25, 2008, 11:46:00 AM »
Quote
Did you use Slickedit's GNU/C++ wizard to create the project?

Yes, I did. Is this good or bad or just for information?

It was to give anyone else reading this thread, an idea of what you actually did.

If make all (make all targets) finds nothing to do it sounds like there's something wrong with the make file because presumably you don't have an .exe yet.

Graeme

Knarkargott

  • Community Member
  • Posts: 8
  • Hero Points: 0
Re: Problem with "iostream"/"iostream.h"
« Reply #5 on: April 29, 2008, 11:48:23 AM »
I haven't done make files, so I finally gave up and started using Visual C++ for now. Hopefully I will learn how to deal with the make files some day :)

Thanks anyway for your help Graeme!
I learned a lot so it wasn't a complete waste of time :)
« Last Edit: April 29, 2008, 11:50:19 AM by Knarkargott »