Re: gtkmm with VS2005 vd2 option



On Wed, Oct 01, 2008 at 03:56:35PM +0200, Stefani Leonardo wrote:
> 
> I am trying to compile an gtkmm 2.12 program with /vd2 option 
> 
> This C++ sample, compiled with /vd2 option on Visual Studio C++  2005, 
> 
> // cl /vd2 /Zi /MDd r.cpp
> #include <sstream>
> int main()
> {
> 	std::stringstream *s = new std::stringstream;
> 	delete s;
> }
> 
> crashes. (Note no GTKmm is linked).
> 
> What C++ libraries can I use ?
> /vd2 is mandatory on gtkmm programs?

This don't solve the Problem, but why you don't build with /EHsc or /EHa?
Without this option this there

#include <sstream>
#include <iostream>
#include <stdexcept>
#include <typeinfo>

int main()
{
  try {
    std::stringstream *s = new std::stringstream;
    delete s;
    std::cout << "OK" << std::endl;
  }
  catch (const std::exception& ex) {
    std::cerr << "catch: std::exception of type: " << typeid(ex).name() << "\n"
                 "  what: " << ex.what()    << std::endl;
  }
  catch (...) {
    std::cerr << "catch: unknown exception" << std::endl;
  }
}

cl /vd2 /MDd /Zi /EHsc r.cpp   # failed with unhandled win32 exception
cl /vd2 /MD  /Zi /EHsc r.cpp   # OK
cl /vd2 /MDd /Zi /EHa  r.cpp   # catch: unknown exception
cl /vd2 /MD  /Zi /EHa  r.cpp   # catch: unknown exception
cl /vd2 /MTd /Zi /EHsc r.cpp   # OK
cl /vd2 /MT  /Zi /EHsc r.cpp   # OK
cl      /MDd /Zi /EHa  r.cpp   # OK
cl      /MD  /Zi /EHa  r.cpp   # OK
cl /vd2      /Zi /EHa  r.cpp   # OK

/MDd = Multi-threaded Debug DLL (/MDd)
/MD  = Multi-threaded DLL (/MD)

/MTd = Multi-threaded Debug (/MTd)
/MT  = Multi-threaded (/MT)

gtkmm is not possible to build with /MTd or /MT

The debug version is failed with /MDd /Zi /EHsc. This is bad.
The release version is running well.

Regards,
Urs


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]