rMX
rMX

Reputation: 1090

Typedef function pointer error

I'm trying to compile some legacy C++ project and ran into an error, and I can't figure out what's going on.

The error is in this line (18):

 typedef uint16_t (*vfunc)();

GCC output:

vflow.h:18: warning: ISO C++ forbids declaration of 'uint16_t' with no type
vflow.h:18: error: typedef 'uint16_t' is initialized (use decltype instead)
vflow.h:18: error: 'vfunc' was not declared in this scope

My C++ is even worse than my English; please help. =)

Upvotes: 0

Views: 646

Answers (1)

Jonathan Leffler
Jonathan Leffler

Reputation: 753675

Transferring my comment to an answer:

Have you included either <stdint.h> or <cstdint> beforehand so you have uint16_t defined? It looks like you don't yet have uint16_t defined.

Judging from the response, this is your problem.

Upvotes: 7

Related Questions