QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1782|回复: 1

skyeye1.22REL在MINGW上编译没法通过

[复制链接]
发表于 2007-3-16 14:17:22 | 显示全部楼层 |阅读模式
gcc -g -O2 -g -O2 -D_FILE_OFFSET_BITS=64 -DSTANDALONE -DDEFAULT_INLINE=0 -DMODET -mthreads -mms-bitfields -DMODET -I arch/arm -I arch/arm/common -I arch/arm/common/mmu -I arch/arm/mach -I arch/bfin/common -I arch/bfin/mach -I arch/coldfire/common -I device -I device/net -I device/lcd -I device/flash -I device/uart -I utils -I utils/share -I utils/main -I utils/config -I utils/debugger  -DARM  -I. -DWIN32_LCD -c device/uart/skyeye_uart.c -o binary/skyeye_uart.o
In file included from device/uart/skyeye_uart.c:28:
utils/portable/gettimeofday.h:39: error: redefinition of `struct timezone'
utils/portable/gettimeofday.h:43: error: conflicting types for 'gettimeofday'
d:/MinGW-develop/bin/../lib/gcc/mingw32/3.4.2/../../../../include/sys/time.h:40: error: previous declaration of 'gettimeofday' was here
utils/portable/gettimeofday.h:43: error: conflicting types for 'gettimeofday'
d:/MinGW-develop/bin/../lib/gcc/mingw32/3.4.2/../../../../include/sys/time.h:40: error: previous declaration of 'gettimeofday' was here
d:\MinGW-develop\bin\make.exe: *** [binary/skyeye_uart.o] Error 1

是不是需要提供一个补丁解决一下?
发表于 2007-3-16 16:01:06 | 显示全部楼层
你是不是用最新版的 MinGW,我的 MinGW 中的 time.h 没有 gettimeofday.

修改 utils/portable/gettimeofday.h 如下:
[code:1]
/*
        gettimeofday.h - portable gettimeofday function for skyeye
        Copyright (C) 2007 Skyeye Develop Group
        for help please send mail to <[email protected]>

        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation; either version 2 of the License, or
        (at your option) any later version.

        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.

        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/*
* 03/03/2007   initial version by Anthony Lee
*/

#ifndef __SKYEYE_GETTIMEOFDAY_H__
#define __SKYEYE_GETTIMEOFDAY_H__

#include <sys/time.h> /* for struct timeval */

#define HAVE_GETTIMEOFDAY

#if defined(__MINGW32__)
        #include <_mingw.h>
        #if (__MINGW32_MAJOR_VERSION < 3)
                #undef HAVE_GETTIMEOFDAY
        #elif (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION < 10)
                #undef HAVE_GETTIMEOFDAY
        #endif
#endif /* defined(__MINGW32__) */


#ifndef HAVE_GETTIMEOFDAY

#if defined(__MINGW32__)
/* we just use timeval, timezone is ignored. */
struct timezone {
};
#endif /* defined(__MINGW32__) */

int gettimeofday(struct timeval *tv, struct timezone *tz);

#endif /* HAVE_GETTIMEOFDAY */


#endif /* __SKYEYE_GETTIMEOFDAY_H__ */
[/code:1]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-23 05:10 , Processed in 0.038587 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表