I get the error unknown type name 'uint32_t'
and included stdint.h
. uint8_t
doesn't produce an error, neither does uint16_t
.
I'm using MinGW and the following 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
Code:
uint32_t function(void) {
return VALUE;
}
And the includes:
#include <stdio.h>
#include <string.h>
#include "mongoose.h"
#include "main.h"
#include <stdint.h>
To answer my own question, changing the order of the includes seemed to do the trick.
If
#include "main.h"
#include <stdint.h>
didn't work, but
#include <stdint.h>
#include "main.h"
did, it is likely that your main.h
file relies on stdint.h
. That means you should add #include <stdint.h>
to main.h
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With