Skip Nav
Home » Forums » SystemC Forum

Icon - KMLM List KMLM List

View email archives for the history of this mailing list.

List Home All Archives Dates Threads Authors Subjects
systemc-forum - Re: [Systemc-forum] MSVC strangeness... Message Thread: Previous | Next
  • To: Brad Chamberlain <brad.chamberlain@xxxxxxxxxx>
  • From: Martin Janssen <Martin.Janssen@xxxxxxxxxxxx>
  • Date: Thu, 23 May 2002 09:38:20 +0200
  • Cc: systemc-forum@xxxxxxxxxxxxxxxxxxx
Send Email to systemc-forum@osci.kavi.com:
Send new message
Reply to this message
Hi Brad,

I can reproduce the problem when compiling and running in a cygwin shell.
But if I change the code as follows, it works fine:

#include <fstream>
#include <iostream>
#include "systemc.h"

sc_clock sysClock;

int main() { // int return type instead of void

cout << "Hello, world!" << endl;
return 0; // use return instead of exit
}

This still doesn't explain why your original code fails, but it might help.

Martin
-oo-


Brad Chamberlain wrote:

Hi Martin --

Thanks very much for checking this out.  One detail that I forgot to
mention was that I only saw the "Stopped (user) (core dumped)" message
when running the executable from the command line, not when running from
within Visual Studio.  Hoewver, in typing up a precise set of instructions
to send to you which explained this, I realized that I only see this
behavior when running within the cygwin bash shell, not when running from
a windows prompt.  Thus, it appears that the behavior, though strange, may
be coming from a bad interaction with the cygwin environment, and since
cygwin isn't supported with SystemC, I guess I can't complain.  Still, it
is odd, given that the cygwin shell is presumably just running the
executable?

Anyway, thanks very much for the time you spent taking a look at this.

-Brad


On Tue, 21 May 2002, Martin Janssen wrote:


Hi Brad,

I tried your code with SystemC 2.0.1 on Windows NT (SP6a) and VC6 (SP5)
but cannot reproduce the problem (with exit(0) commented and uncommented).
Just like you did, I took one of the example .dsw files and only changed
the single .cpp file (commented the code, added your code).

Martin
-oo-


Brad Chamberlain wrote:


I've recently been trying to port some SystemC code that I've been
writing from g++ to MSVC. While most of my code is working fine, I am
getting one strange behavior that I cannot explain. I've boiled a more
complicated program that shows the behavior down to the trivial hello
world-style example that follows:

#include <fstream>
#include <iostream>
#include "systemc.h"

sc_clock sysClock;

void main() {

cout << "Hello, world!" << endl;
// exit(0);
}

When compiled as-is and run, it prints out the message, and then
follows it with a diagnostic message stating "File size limit
exceeded." When the exit() statement is uncommented (or a return from
main is used), the message does not appear. I cannot determine what
the source of this message is, nor how to avoid it in the general
case. Compiling and running the same code under g++ works fine.

My compilation command lines are shown below. Creating the .exe using
one of the example .dsw files provided with the release (swapping my
source for the examples) produces a slightly different message, but
similarly confusing:

Stopped (user) (core dumped)

Does anyone know what's causing either of these messages?

Thanks,
-Brad

$ cl /GX /GR hello.cpp /I../../third-party/systemc-2.0.1/src
../../third-party/systemc-2.0.1/msvc60
/systemc/Debug/systemc.lib /link /nodefaultlib:libcd
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

hello.cpp
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:hello.exe
/nodefaultlib:libcd
hello.obj
../../third-party/systemc-2.0.1/msvc60/systemc/Debug/systemc.lib

_______________________________________________
Systemc-forum mailing list
Systemc-forum@xxxxxxxxxxxxxxxxxxx
https://server2.systemc.org/mailman/listinfo/systemc-forum











--
---------------------------------------------------
 Martin.Janssen@xxxxxxxxxxxx
 System Level Design Tools    Synopsys GmbH
                              Kaiserstrasse 100
 tel: +49 2407 9558 65        D-52134 Herzogenrath
 fax: +49 2407 9558 44        Germany
---------------------------------------------------




By Date: Previous | Next Current Thread By Thread: Previous | Next


  Mail converted by the most-excellent MHonArc 2.6.10