Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7527843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:12:40+00:00 2026-05-30T04:12:40+00:00

I am trying to add GLM to a project in Xcode 4, but I

  • 0

I am trying to add GLM to a project in Xcode 4, but I cannot get it to compile. I have added the glm files to my project through the add files dialog.

I get a lexical/preprocessor issue and Xcode cannot find the file <cmath>.

I am not sure what I need to tweak to get this to build.

I have seen How do I add OpenGL Mathematics (GLM) to Xcode 4? already.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:12:41+00:00Added an answer on May 30, 2026 at 4:12 am

    All you need to do is add the files to the project and #import "glm.hpp" (for Objective-C++; for simple C++ it should just be #include "glm.hpp").

    A couple things to be careful of:

    • The OpenGL Mathematics library, when you download it, comes with a bunch of stuff you don’t need (test code, extraneous utilities). Adding these to your project will result in compile errors which I could not get rid of. The only directory you need is the glm/ directory; you can delete the test/, util/, doc/, and bench/ directories. If you were trying to follow “How do I add OpenGL Mathematics (GLM) to Xcode 4?” and were still having problems, this may be the thing which was tripping you up.

    • The OpenGL Mathematics documentation tells you to include the or files. In Xcode 4, you should include them like “glm.hpp” or “*.hpp”. Xcode will find the files no matter where in the project they are. Supposedly you can add a user-defined build setting “USE_HEADERMAP” and set it to “NO” to disable this, but I didn’t have any luck with that.

    • And, just in case, note that your code files using the OpenGL Mathematics library must be Objective C++ files (ending in “.mm”), not the default/plain Objective C files (ending in “.m”). It is very much a C++ library after all… 🙂

    I hope that help. I was just working through this myself, and I haven’t had the chance to really push this (e.g. I’ve basically just added a mat4 object or two and made sure things still compiled), but it seems to be working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when trying to add a project to my WebSphere, I get the following error:
I'm trying add vertical lines to my grid. I have found some examples but
Trying to add an onclick handler to my tabs, and can't seem to get
Im trying to add a directory foo to my repo, but there are some
Trying to add a 'class' html attribute, but I think the keyword 'class' is
In trying to add a cached section to a Mako template, I get the
Trying to add scrollbars to a listview within a dialog in JQueryMobile with no
im trying to add a css class in my javascript code but when i
Trying to add django-registration to my app. I have installed setup tools to use
I'm trying add a directory of jar files (or barring that, each jar file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.