【发布时间】:2012-01-21 14:19:56
【问题描述】:
我收到错误 unknown type name 'uint32_t' 并包含 stdint.h。 uint8_t 不会产生错误,uint16_t 也不会。
我正在使用 MinGW 和以下 make-lines:
# Build for Windows under MinGW
#MINGWDBG= -DDEBUG -O0
MINGWDBG= -DNDEBUG -Os
#MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,console $(MINGWDBG) -DHAVE_STDINT
MINGWOPT= -W -Wall -mthreads -Wl,--subsystem,windows $(MINGWDBG)
mingw:
windres win32\res.rc win32\res.o
gcc $(MINGWOPT) mongoose.c -lws2_32 \
-shared -Wl,--out-implib=$(PROG).lib -o $(PROG).dll
gcc $(MINGWOPT) mongoose.c main.c win32\res.o -lws2_32 -ladvapi32 \
-o $(PROG).exe
代码:
uint32_t function(void) {
return VALUE;
}
其中包括:
#include <stdio.h>
#include <string.h>
#include "mongoose.h"
#include "main.h"
#include <stdint.h>
【问题讨论】:
-
提供 uint32_t 是可选的。更新你的盒子,你使用的是 16 位处理器。
-
更新信息。不错的评论 Johannes Schaub :) 但实际上没有使用 16 位处理器。