Re: [ng-spice-devel] ACS on Win32 with MinGW
On Mon, 23 Apr 2001, Gillespie, Alan wrote:
> This is not worth spending much thought on, but I
> got ACS to compile using the MinGW version of gcc.
>
> However, it crashes before it even gets into the
> main program. That is, it seems to crash during
> the construction of some global objects.
It works fine with the "cygwin" version of gcc.
> Does anyone know how you debug that part of a C++
> program with gdb ?
The same way as any other part of the program.
For me, the most useful feature is the back-trace. This is the
command "bt" in gdb. It usually points directly to the problem.
Of course, you need to compile with debugging enabled.
("make debug" with the standard ACS makefile.)
> Al, someone here told me that the C++ constructor
> stuff can be a nightmare, since the order of
> initialization is undefined, apparently. Do you
> know of any "risky" stuff in your constructors ?
The order of construction is very well defined, within a module, as
is the order of destruction. What is undefined is the order of
construction of globals and statics in different modules. The
solution is to declare everything where this matters in a single
module, which is why "globals.cc" exists. (also, because of some old
junk hanging around).
By the way .... I highly recommend the "cygwin" tools for windows.
It contains many of the gnu tools, often making porting a unix
program to windows trivial. For ACS, modelgen, and the ibis
translator, "just type make" works. No changes required.
Partial thread listing: