c++ - using COUT with DMC 7.5
- robert (17/17) May 16 2008 Hello fellow programmers,
- torhu (3/20) May 16 2008 Do you get any error message from the compiler or linker? That code
- robert (12/14) May 16 2008 Nope no error message from compiler nor from the linker.
- robert (8/28) May 17 2008 Nope, didn't get any compiler or linker errors.
- Heinz Saathoff (15/27) May 21 2008 I haven't used the debugger yet because I'm mostly writing/maintaining
Hello fellow programmers, This is my first attempt to make use of the DMC compiler, and it's proving to be an uphill climb. My program is very simple, wanting to write a string out to the console, like this: #include <iostream.h> int main() { cout << "Hello World...\n"; } When I try running this under the debugger, attempt to step over the COUT are met with an assembly window popping open, with a caption that says "Unknown Procedure". I'm sure that I need to link with some library, or something similar, but I've been stuck for quite a while. Thanks in advance for any help you can provide, Robert
May 16 2008
robert wrote:Hello fellow programmers, This is my first attempt to make use of the DMC compiler, and it's proving to be an uphill climb. My program is very simple, wanting to write a string out to the console, like this: #include <iostream.h> int main() { cout << "Hello World...\n"; } When I try running this under the debugger, attempt to step over the COUT are met with an assembly window popping open, with a caption that says "Unknown Procedure".Do you get any error message from the compiler or linker? That code works just fine for me.
May 16 2008
== Quote from torhu (no spam.invalid)'s articleDo you get any error message from the compiler or linker? Thatcodeworks just fine for me.Nope no error message from compiler nor from the linker. That's the strange part, because if there had been an error, I would have fixed that (before asking questions here). What version of DMC are you running? Because, admittedly, mine is years out of date; although, I can't see why/how that would matter. Did you have to set any particular linker options, so that it would know which libraries to use? This code is so simple, that I'm surprised it won't work. Thanks for the reply, and for any further clues you might have.
May 16 2008
== Quote from torhu (no spam.invalid)'s articlerobert wrote:codeHello fellow programmers, This is my first attempt to make use of the DMC compiler, and it's proving to be an uphill climb. My program is very simple, wanting to write a string out to the console, like this: #include <iostream.h> int main() { cout << "Hello World...\n"; } When I try running this under the debugger, attempt to step over the COUT are met with an assembly window popping open, with a caption that says "Unknown Procedure".Do you get any error message from the compiler or linker? Thatworks just fine for me.Nope, didn't get any compiler or linker errors. If I had, I would have fixed them before posting here. Did you use any special linker options to get it to run? It's such simplistic code, I am surprised that it is so difficult to get it working. Thanks for the reply, and for any other clues that come to mind.
May 17 2008
Hello, robert wrote...#include <iostream.h> int main() { cout << "Hello World...\n"; } When I try running this under the debugger, attempt to step over the COUT are met with an assembly window popping open, with a caption that says "Unknown Procedure". I'm sure that I need to link with some library, or something similar, but I've been stuck for quite a while.I haven't used the debugger yet because I'm mostly writing/maintaining DOSX programs. But just a guess: When you step over the debugger might look for the next statement to halt. But in your program the cout line is the only statement present. You can try to add a dummy statement, so that your program looks like this: int main() { int ret; cout << "Hello World...\n"; ret = 19; // dummy statement return ret; // another one } - Heinz
May 21 2008