TCanvas w/ Visual C++

Thanks for your help. Here’s my problem:

I’m using Visual C++ v 7.0.9466 and Root Version 4.04/02 binary for windows.

I’m getting the following error when I try to instantiate a TCanvas object.

Creating the canvas . . .
: passed oldsize 4000, should be 459253
Fatal in : unreasonable size (459253)
aborting
Warning in TWinNTSystem::StackTrace: this method must be overridden!

The code is pretty simple:
TCanvas *canvas = new TCanvas(“PDE Canvas”);

I cannot reproduce this problem.
Probably you are mixing versions of ROOT (check your PATH)
or you have a rootlogon.C file with some funny code.

More details required from your side.

Rene

Here’s an example.

I have a function which call to testWritingRoot(); e.g.

[code]void bPDE::init(const string parametersFilePath, const string outputFolderPath)
{
testWritingRoot();
this->parametersFilePath = parametersFilePath;

          . . .

[/code]

The actual functioin is:

int testWritingRoot(void) { // TODO: Please replace the sample code below with your own. TCanvas *canvas = new TCanvas("You'll never see me."); TRandom *tRand = new TRandom(); TFile *tFile = new TFile("root_file.root"); TH1F *h1 = new TH1F("h1","my histogram",100,-3,3); for (int i=0;i<10000;i++) h1->Fill(tRand->Gaus(0,1)); h1->Draw(); canvas->SaveAs("Hist.C"); canvas->Close(); canvas->Delete(); tFile->Write(); tFile->Save(); return 0; }

These are the headers i’m including:

//ROOT Includes #include "TMatrixD.h" #include "TCanvas.h" #include "TH2D.h" #include "TMatrixDEigen.h" #include "TRandom.h" #include "TDecompChol.h" #include "TFile.h"

The error is:
: passed oldsize 4000, should be 459253
Fatal in : unreasonable size (459253)
aborting
Warning in TWinNTSystem::StackTrace: this method must be overridden!

Here are also are my compile and link command lines:

/OUT:"C:\Program Files\PDE/betaPDE.exe" /VERSION:1.0 /INCREMENTAL /LIBPATH:"C:\RootWin\lib" /DEBUG /PDB:"C:\Program Files\PDE/rhoPDE.pdb"   kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

I also list the following for linking:

Thanks for your help.

You should remove libNew.lib from the list of libs.
This lib should be used only when using the shared memory class TMapFile.

Rene