Avoiding attempts to compile windows.h on Mac OSX

bttester
Posts: 2
Joined: Wed Apr 30, 2014 10:55 am

Avoiding attempts to compile windows.h on Mac OSX

Post by bttester »

Hi,

I am on a Mac in Qt and have included all the files in the src/ directory in my Qt project. When I attempt to compile, it gets stuck on the required "windows.h" header that of course does not exist on a Mac/Unix. This file is included in a DX11 cpp file, so I attempted to exclude that from Qt's build process, but that just resulted in linker errors.

How can I avoid Qt trying to build this with the windows.h file? Or perhaps more specifically, what Windows-required cpp files can I safely exclude from the build process that will not result in linker problems from other files?
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Avoiding attempts to compile windows.h on Mac OSX

Post by Basroil »

1) Get rid of any DX11 demos
2) Make sure your compiler is defining the targets correctly
3) Try using the files directly, the core files don't actually have a need for windows.h
bttester
Posts: 2
Joined: Wed Apr 30, 2014 10:55 am

Re: Avoiding attempts to compile windows.h on Mac OSX

Post by bttester »

Thanks; not sure what you mean by "demos" as I'm working strictly with the bullet source files, not any demo projects.

What I did to get it to compile is to remove the DX11 and OpenCL folders entirely from the source package. Now it compiles. Does anyone know if this could cause a serious problem to have the OpenCL folder removed? Removing the DX11 source files and headers was not enough, since the linker still complained, no doubt because of files in OpenCL needing the DX11 definitions.
Basroil
Posts: 463
Joined: Fri Nov 30, 2012 4:50 am

Re: Avoiding attempts to compile windows.h on Mac OSX

Post by Basroil »

bttester wrote:no doubt because of files in OpenCL needing the DX11 definitions.
Odd, none of the OpenCL softbody solver files should be referencing DX11, especially since DX11 means the competing DirectCompute format. However, OpenCL requires that you download the OpenCL SDK, just as DX11 needs the DX11 SDK.

What is likely happening is that you included the btMultiThreaded source files into your project and the compiler is attempting to compile all files in your project rather than just the used ones. The DX11 softbody solver indeed skips the check for Win32/Winx64, which is not really a bug but just a feature left out by accident (since most people wouldn't include those solvers unless they absolutely know they want to use them)