Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve typedef redefinition in C++?

Tags:

c++

typedef

I imported some code into my project, but there is a line: typedef signed char byte;

But the byte has been typedef in rpcndr.h. There are many codes using this type, so just changing the name is a difficult thing. I'm wondering if there's an easy way to solve such redefinition?

P.S. My code is running on Windows and all codes do not has a namespace, so add namespaces is equal to change type name.

like image 430
zzy Avatar asked Sep 04 '25 03:09

zzy


1 Answers

Try adding: #define WIN32_LEAN_AND_MEAN before your includes.

What does #defining WIN32_LEAN_AND_MEAN exclude exactly?

like image 137
marsh Avatar answered Sep 05 '25 23:09

marsh