jamesrogers93
jamesrogers93

Reputation: 411

Visual Studio Shared Library (Android, iOS) headers not found on mac

I am building a multi-platform library for Android and iOS in Visual Studio 2017 using the 'Shared Library (Android, iOS)' template.

I have properly configured visual studio to pair with my Mac to build the iOS library by following this webpage from Microsoft:

https://blogs.msdn.microsoft.com/vcblog/2015/06/04/developing-cross-platform-ios-applications-using-visual-studio/

Everything works fine. I am able to build the Android and iOS libraries without any problem.

However, I want to add the GLM include headers to my project. To do so, I need to have a copy of the GLM headers on the windows desktop and the mac, and reference the GLM directory on the mac in the 'Local-Remote Directories Map' section in the project settings, as explained in the 'Setting up and editing my iOS code' section in the above link.

My problem is the GLM headers cannot be found on the mac when compiling. I get:

1>/Users/James/.../Renderer.h:8:10: fatal error: 'glm\glm.hpp' file not found.

1>#include <glm\glm.hpp>
1> ^

Here is a screenshot of 'Local-Remote Directories Map' in the project settings in VS. Which should essentialy replace the directory of GLM on my windows pc to the directory of GLM on the mac.

And here is a print out from the terminal on the mac indicating the location of the GLM headers:

JamesMacBookAir:Libraries James$ ls
glm

JamesMacBookAir:Libraries James$ pwd
/Users/James/Libraries

The android library is compiling without a problem with the GLM headers, but it is being compiled on the windows desktop, not the mac.

Any idea what could be causing this?

Update:
I have just tried putting the glm headers in the same folder as the source files and I am getting the same error on the mac.

Upvotes: 1

Views: 542

Answers (1)

jamesrogers93
jamesrogers93

Reputation: 411

Solved it.

I needed to change the backslash in the glm include to a forward slash:

#include <glm\glm.hpp>

to

#include <glm/glm.hpp>

Upvotes: 1

Related Questions