[Ace-users] [ace-users] ACE-5.6.2 can't be compiled (use gcc-4.2.1) in mingw in Windows XP

haibin zhang dragzhb at yahoo.com.cn
Tue Jan 22 21:23:31 CST 2008


The following is patches to fix the bug:

1. vi platform_gnuwin32_common.GNU in
include/makeinclude

ifeq (3.4,$(findstring 3.4,$(GNUWIN32_CXX_VERSION)))
  MODEL_FLAGS += -mtune=$(TCPU)
else
  MODEL_FLAGS += -mcpu=$(TCPU)
endif

add ifeq (4.2,$(findstring
4.2,$(GNUWIN32_CXX_VERSION)))

find -lnetapi32 , then add -lgdi32 // <-- fix ssl
build bug

2. modify ace/config-win32.h to comment the following
lines

// comment the following lines
//#define ACE_Proper_Export_Flag __declspec
(dllexport)
//#define ACE_Proper_Import_Flag __declspec
(dllimport)
//#define ACE_EXPORT_SINGLETON_DECLARATION(T) template
class __declspec (dllexport) T
//#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE,
CLASS, LOCK) template class __declspec (dllexport)
SINGLETON_TYPE<CLAS
S, LOCK>;
//#define ACE_IMPORT_SINGLETON_DECLARATION(T) extern
template class T
//#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE,
CLASS, LOCK) extern template class SINGLETON_TYPE
<CLASS, LOCK>;

3. vi ace/OS_NS_stdio.inl to fix these bugs:
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl: In function
'int ACE_OS::flock_unlock(ACE_OS::ace_flock_t*, short
int, ACE_OFF_T, A
CE_OFF_T)':
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl:137: warning:
operation on 'ace_result_' may be undefined
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl: In function
'int ACE_OS::flock_rdlock(ACE_OS::ace_flock_t*, short
int, ACE_OFF_T, A
CE_OFF_T)':
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl:206: warning:
operation on 'ace_result_' may be undefined
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl: In function
'int ACE_OS::flock_wrlock(ACE_OS::ace_flock_t*, short
int, ACE_OFF_T, A
CE_OFF_T)':
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl:358: warning:
operation on 'ace_result_' may be undefined
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl: In function
'char* ACE_OS::cuserid(char*, size_t)':
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl:409: warning:
dereferencing type-punned pointer will break
strict-aliasing rules
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl: In function
'wchar_t* ACE_OS::cuserid(wchar_t*, size_t)':
d:/cdev/ACE_wrappers/ace/OS_NS_stdio.inl:500: warning:
dereferencing type-punned pointer will break
strict-aliasing rules


Regards

Zhang HaiBin



--- "Douglas C. Schmidt"
<schmidt at dre.vanderbilt.edu>写道:

> Hi, 
> 
>     Thanks for using the PRF.
> 
> >I found ACE-5.6.2 can't be compiled using gcc-4.2.1
> in
> >mingw in windows XP
> >
> >I checked config*.h , I can't found gcc 4.2.x MICRO
> in
> >config*.h
> 
> Supported MinGW isn't a high priority for us.  If
> you'd like to figure
> out what fixes are required and send them to us that
> would be great.
> 
> Thanks,
> 
>         Doug
> 
> >Mingw team has released gcc -4.2.1, you can
> download
> >from :
>
>http://sourceforge.net/project/showfiles.php?group_id=2435
> >
> >
> >Regards
> >
> >Zhang HaiBin
> >
> >
> >ACE VERSION: 5.6.2
> >HOST MACHINE and OPERATING SYSTEM
> >TARGET MACHINE and OPERATING SYSTEM, if different
> from
> >
> >HOST:
> >COMPILER NAME AND VERSION (AND PATCHLEVEL):
> >$ uname -a
> >MINGW32_NT-5.1 CH-SZX-HBZHANG1 1.0.11(0.46/3/2)
> >2007-01-12
> >12:05	i686 Msys
> >
> >gcc -v
> >Using built-in specs.
> >Target: mingw32
> >Configured with: ../gcc-4.2.1-2-src/configure
> >--with-gcc --enable-libgomp --host=mingw32
> >--build=mingw32 --target=mingw32 --p
> >rogram-suffix=-sjlj --with-arch=i486
> >--with-tune=generic --disable-werror
> --prefix=/mingw
> >--with-local-prefix=/mingw --enable
> >-threads --disable-nls
> >--enable-languages=c,c++,fortran,objc,obj-c++,ada
> >--disable-win32-registry --enable-sjlj-exceptions
> --
> >enable-libstdcxx-debug
> >--enable-cxx-flags=-fno-function-sections
> >-fno-data-sections
> >--enable-version-specific-runtime-libs --
> >disable-bootstrap
> >Thread model: win32
> >gcc version 4.2.1-sjlj (mingw32-2)
> >
> >
> >
> >This is the warning and error:
> >
> >
> >g++ -fvisibility=hidden -fvisibility-inlines-hidden
> >-DNDEBUG -Wpointer-arith -mthreads
> -mtune=pentiumpro
> >-Wno-attributes -Wal
> >l -W -O3 -pipe   -pipe   -I/d/cdev/ACE_wrappers
> >-DACE_NDEBUG -DACE_USE_RCSID=0 -DACE_HAS_EXCEPTIONS
> >-DACE_NO_INLINE -I.. -DAC
> >E_BUILD_DLL  -c  -o .shobj/Local_Name_Space.o
> >Local_Name_Space.cpp
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32-mingw.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:41,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
> >d:/cdev/ACE_wrappers/ace/config-g++-common.h:89:1:
> >warning: "ACE_Proper_Export_Flag" redefined
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
>
>d:/cdev/ACE_wrappers/ace/config-win32-common.h:108:1:
> >warning: this is the location of the previous
> >definition
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32-mingw.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:41,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
> >d:/cdev/ACE_wrappers/ace/config-g++-common.h:90:1:
> >warning: "ACE_Proper_Import_Flag" redefined
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
>
>d:/cdev/ACE_wrappers/ace/config-win32-common.h:109:1:
> >warning: this is the location of the previous
> >definition
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32-mingw.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:41,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
> >d:/cdev/ACE_wrappers/ace/config-g++-common.h:107:1:
> >warning: "ACE_EXPORT_SINGLETON_DECLARATION"
> redefined
> >In file included from
> >d:/cdev/ACE_wrappers/ace/config-win32.h:30,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config.h:1,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-macros.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/config-lite.h:24,
> >                 from
> >d:/cdev/ACE_wrappers/ace/ACE_export.h:11,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Malloc_T.h:18,
> >                 from
> >d:/cdev/ACE_wrappers/ace/Local_Name_Space.h:20,
> >                 from Local_Name_Space.cpp:1:
> 
=== message truncated ===



      ___________________________________________________________ 
雅虎邮箱传递新年祝福,个性贺卡送亲朋! 
http://cn.mail.yahoo.com/gc/index.html?entry=5&souce=mail_mailletter_tagline



More information about the Ace-users mailing list