be careful about #include order


Subject: be careful about #include order
From: Paul Rohr (paul@abisource.com)
Date: Tue Dec 07 1999 - 12:24:10 CST


Bob,

I just reshuffled the order of #includes, so now it should work for you.

Debug builds on Win32 do a little black magic so that all memory accesses
are made through a debug heap which "knows" how to detect specific leaks and
track them back to the original allocation.

To make the necessary macro magic work, system includes have to happen
first, before any of our headers (particularly ut_types.h) are included.
Otherwise you get redefinition errors like those shown below.

Paul

At 10:41 AM 12/7/99 EST, Daniel Berlin wrote:
>Try again now.
>I think this might have been the same problem i was experiencing (He
>forgot to include the include file that declares free(), which is
>stdlib.h).
>I committed a fix for it an hour ago.
>
>>
>>At 07:17 PM 12/6/99 -0600, Stephen Hack wrote:
>>>Files modified:
>>>
>>>M text/fmt/xp/fb_LineBreaker.cpp
>>>M text/fmt/xp/fp_Line.cpp
>>>
>>
>>When built on Windows, this gives the following compilation error:
>>
>>fp_Column.cpp
>>fp_Line.cpp
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(421) : error C2059:
>syntax
>>error: 'constant'
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(421) : error C2733:
>second C
>>linkage of overloaded function '_calloc_dbg' not allowed
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(424) : error C2059:
>syntax
>>error: 'constant'
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(424) : error C2733:
>second C
>>linkage of overloaded function '_free_dbg' not allowed
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(439) : error C2059:
>syntax
>>error: 'constant'
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(439) : error C2733:
>second C
>>linkage of overloaded function '_malloc_dbg' not allowed
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(447) : error C2059:
>syntax
>>error: 'constant'
>>C:\Program Files\DevStudio\VC\INCLUDE\stdlib.h(447) : error C2733:
>second C
>>linkage of overloaded function '_realloc_dbg' not allowed
>>make[4]: *** [/abisource/build/abi/src/WIN32_20.1_i386_DBG/obj/
>fp_Line.obj]
>>Error 2
>>make[3]: *** [build] Error 2
>>make[2]: *** [build] Error 2
>>make[1]: *** [build] Error 2
>>make: *** [compile] Error 2
>>BASH.EXE-2.02$
>>
>>
>>Robert Sievers
>>Open Source Evangelist
>
>
>



This archive was generated by hypermail 2b25 : Tue Dec 07 1999 - 12:19:08 CST