PDA

View Full Version : Ignoring sys/mman.h on windows build?



adzh
12th September 2016, 20:53
I am using Qt to build application for a Xilinx board running Linux. And part of that application uses mman.h to access UIO device.

So far I been working from Linux workstation, but I need to be able for someone else to work from windows computer (Qt with MinGW). At this moment, when I am trying to compile the project, it gives me error that sys/mman.h is not found.

How can I make Qt ignore this error or entire class which uses this include while building application on Windows?

anda_skoa
13th September 2016, 09:13
You can use one of the platform defines to either include only on Linux or exclude on Windows.

E.g.


#ifdef Q_OS_LINUX
// code only compiled on Linux
#endif



#ifndef Q_OS_WIN
// code not built on Windows.
#endif


Cheers,
_