[Trilinos-Users] linking debug on Windows

Matthew Koch mkoch at txcorp.com
Thu Jun 24 11:26:17 MDT 2010


Hello again,

I finally got it to work!  I had to rename the free() methods (and their uses elsewhere) in 
Teuchos_RCPDecl.hpp to freeptr().  I'm not sure if that's an acceptable name for your code style, 
also I'm working off the 10.2.1 tarball, so I'm not sure of the best way to submit a patch if you 
want one...

Thanks for the help!

--Matt

On 6/16/2010 3:03 PM, Matthew Koch wrote:
> I actually tried that, but I got a compiler error, probably because I did something wrong with the
> templates.  If I can't get my other approaches to work I will probably revisit that option.
>
> Thanks,
> Matt
>
> On 6/16/2010 2:45 PM, Bartlett, Roscoe A wrote:
>> 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
>>
>
> _______________________________________________
> 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