[Trilinos-Users] linking debug on Windows

Bartlett, Roscoe A rabartl at sandia.gov
Wed Jun 16 14:45:42 MDT 2010


Matthew,

I don't think that "free" is a resolved keyword in C++ so any implementation that creates a macro called 'free' is a non-ANSI compliant C++ implementation as far as I can tell.

Being that is the case, if there is no work around then we might be able to change the name of the free(...) member function to destroy(...) or something but that technically will break backward compatibility.

Cheers,

- Ross


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Matthew Koch
> Sent: Wednesday, June 16, 2010 11:15 AM
> To: trilinos-users at software.sandia.gov
> Subject: Re: [Trilinos-Users] linking debug on Windows
> 
> I've looked at the compiler options (you can copy them either from the
> buildlog file or in the
> advanced tab under properties) and I'm pretty sure that what few
> differences there are (different
> preprocessor definitions for the most part) are not causing the
> problem.  However, I tried
> outputting the preprocessor .i files and it looks like free is actually
> being redefined as
> _free_dbg, and if I add the #undef free in front of the method
> definition, the include complains
> that it can't find _free_dbg.  So, I suspect that in debug there is a
> difference between how Intel
> expects things to be named and how MSVC is naming them.
> 
> I think there are some options for naming that I can experiment with
> next.
> 
> Thanks,
> Matt
> 
> On 6/16/2010 10:25 AM, Bill Hoffman wrote:
> > On 6/16/2010 12:01 AM, Matthew Koch wrote:
> >> The exact compiler error message is:
> >>
> >> C:\trilinos-10.2.1-Source-serial-
> bin\include\Teuchos_RCPDecl.hpp(934): error: expected a type specifier
> >> 	void free( T* ptr ) { }
> >>     	     ^
> >>
> >
> > I am wondering if free is somehow being redefined or something like
> that...
> >
> >
> > If you run the preprocessor on the code what do you get?
> >
> > With VS IDE, this can be done by right clicking on a file that
> includes
> > Teuchos_RCPDecl.hpp, and changing the properties to save the
> > preprocessed output.   This will create a .i file that will have the
> > expanded code.   It looks  like free is being redefined to something
> else...
> >
> > A quick test of that might be to add a #undef free on line 933 of
> that
> > file and see if it helps...
> >
> > -Bill
> >
> >
> > _______________________________________________
> > Trilinos-Users mailing list
> > Trilinos-Users at software.sandia.gov
> > http://software.sandia.gov/mailman/listinfo/trilinos-users
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list