RE: [ROOT] ROOT 3.04.02 and Visual .Net

From: Langston, Matthew David (langston@SLAC.stanford.edu)
Date: Tue Feb 25 2003 - 21:30:21 MET


Hi Heather,

I am able to link my VC.NET projects against ROOT 3.04.02 built with vc6
(the one downloaded from root.cern.ch). I tried to reproduce your
problem with the following simple test case:


#include <tchar.h>
#include <fstream>
#include "TPaveText.h"

using namespace std;

void _tmain(void)
{
	ofstream ofs ( "test.txt" );
	TPaveText* oTPaveText = new TPaveText();
	oTPaveText -> SavePrimitive( ofs, "" );
	delete oTPaveText;
}


This little example compiled and linked fine for me against vanilla ROOT
3.04.02 (it won't run, of course, but your problem was with
linking). Does this file compile and link for you? If so, maybe it will
give you a place to start to figure out where the problem is. If not,
let us know and we'll figure it out.

To make this VC.NET project I crated a new "Managed C++ Application",
then turned off managed extensions (set "Use Managed Extensions" to "No"
in "Configuration Properties | General"). I also turned off support for
precompiled headers and deleted stdafx.h and stdafx.cpp.

BTW, the post from Axel about not discussing .NET issues in roottalk was
inappropriate. He should not have discouraged you (nor should he
discourage anyone else) about discussing .NET issues as they pertain to
ROOT.

Additionally, our experience with .NET differs quite dramatically from
Axel's assertions. We have found .NET to be extremely stable. Axel's
claims about having to make 100 work-arounds has not been or
experience. We made 0 changes to use VS.NET with the current vc6
binaries, and only 2 changes (one compile flag and one source code
change) to build ROOT 3.04.02 from source using VC.NET.

Overall, our experience has been that, under Windows, VS.NET is the
preferred compiler platform for using ROOT.

Warmest regards, Matt

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU


-----Original Message-----
From: Axel Naumann [mailto:axel@fnal.gov] 
Sent: Tuesday, February 25, 2003 10:49 AM
To: Heather Kelly
Cc: roottalk@pcroot.cern.ch
Subject: Re: [ROOT] ROOT 3.04.02 and Visual .Net

Hi,

I managed to build root with .NET without any problems; I didn't come 
around testing whether linking VC6 libs within .NET works. So I have not 
had this problem because I've never tried it.

Either way: The standard c++ lib for .NET and VC6 differ, so my 
assumption would be (now, it wasn't a few weeks ago) that cross linking 
will only work when using the backward compatible .NET std lib - which 
doesn't sound like a good idea, because that gives you the same buggy 
lib people were fighting with under VC6.

As Rene might not like a public discussion on this (it's not a bug 
report as .NET is not supported, and .NET is so buggy that supporting it 
and adding 100 work-arounds won't really pay off), we should maybe 
migrate it to a closed forum. Valeri: Have you seen this? Did you test it?

Either way, building root from sources with .NET instead of using the 
binary distribution for VC6 should get rid of this problem.

Cheers, Axel.

Heather Kelly wrote:
> Hi,
> 
> I have seen plenty of discussion concerning ROOT & Visual .Net - we are 
> using ROOT 3.04.02 on Windows.
> It was my understanding from previous posts that one could link against 
> the ROOT binaries compiled with VC6.
> However, we have run into trouble when compiling/linking (using Visual 
> .Net) our ROOT I/O classes against ROOT 3.04.02 (compiled with VC6), 
> specifically related to TObject::SavePrimitive:
> 
> mcRootData.arc(McPositionHit.obj) : error LNK2001: unresolved external 
> symbol "public: virtual void __thiscall TObject::SavePrimitive(class 
> std::basic_ofstream<char,struct std::char_traits<char> > &,char const 
> *)" 
> (?SavePrimitive@TObject@@UAEXAAV?$basic_ofstream@DU?$char_traits@D@std@@@std 
> @@PBD@Z)
> 
> 
> Clearly, others have not had this problem...is there a known cause for 
> this?  and is there an easy fix?
> 
> Thanks,
> Heather



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET