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

  • SEARCH
  • Home
  • 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 8647785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:09:20+00:00 2026-06-12T13:09:20+00:00

I keep getting warnings only in XCode about some macros in glm being redefined.

  • 0

I keep getting warnings only in XCode about some macros in glm being redefined. it’s not a huge issue but I find warnings annoying.

If I put a #ifndef block over the culprit macros but then the entire system wont work? I include them in a static lib which is linked to an app which also includes them. I though this might be the issue so I removed it from one of the two to see if it helped. It didn’t.

This warning does not appear when using mingw g++ on windows but it does in Xcode 4. I am using glm version 0.9.3.4.

Warnings:

"VECTORIZE2_VEC" redefined
This is the location of the previous definition

This is repeated hundreds of times.

Culprit code (taken from glm file _vectorize.hpp):

#define VECTORIZE2_VEC(func) \
template <typename T> \
GLM_FUNC_QUALIFIER detail::tvec2<T> func( \
    detail::tvec2<T> const & v) \
{ \
    return detail::tvec2<T>( \
        func(v.x), \
        func(v.y)); \
}

There are a few other macros very similar to this one.

  • 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-06-12T13:09:22+00:00Added an answer on June 12, 2026 at 1:09 pm

    Based on the comments above, it appears as though you have 3 options:

    1. Just live with the compilation warnings

    2. Change the location of your VECTORIZE2_VEC macro definition with respect to the #include’s, since the other definition of VECTORIZE2_VEC has not wrapped it in an #ifndef (and this is causing the compilation warning)

    3. Consider if you really need to #define it again, considering its already defined.

    Option 1 is ok, but if you have a “no compilation warning” requirement, which is actually a good thing, then you’ll have to go with option 2 (which in my opinion could become difficult to maintain) or 3.

    To implement option 2, you will need to define the macro after the include where it is originally defined, but before the other #include’s that need it. This may not be possible, if you get the original definition and the compilation error by just #including one file, in which case you’re out of luck.

    Assuming file1.h has the original VECTORIZE2_VEC definition, and file2.h needs the definition and causes a compilation error in its absence, the following could fix the problem and be error and warning free:

    #include <file1.h>
    
    #ifdef VECTORIZE2_VEC 
      #undef VECTORIZE2_VEC 
    #endif
    #define VECTORIZE2_VEC(func) ....
    
    #include <file2.h>
    
    // ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We keep having some customers getting a warning from AVG Antivirus about our application.
Keep getting the error Arguments are not sufficiently instantiated for the multiplication by addition
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I keep getting depreciation warnings while testing in Rails 3.1 like RailsProject$ bundle exec
I keep getting this error and i have been trying everything for about a
I keep getting warnings in Eclipse for hard-coding strings in my Android XML layout,
Ever since I updated to Kobold2d 2.0.4 I keep getting these warnings in the
When building static libraries with VS2005 I keep getting linker warnings that VC80.pdb cant
I have a web app built against asp.net 2.0, but keep getting the following
I'm trying to pip install PIL on my amazon instance, but i keep getting

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.