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 6925777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:49:59+00:00 2026-05-27T10:49:59+00:00

Using glew, I’m trying to link the simple program #include </usr/include/GL/glew.h> int main (int

  • 0

Using glew, I’m trying to link the simple program

#include </usr/include/GL/glew.h>

int main (int argc, const char * argv[])
{

    glewInit();

    return 0;
}

in XCode 4, under OSX Lion, which reports the error:

ld: library not found for -lGLEW.1.7.0
Command /Developer/usr/bin/clang++ failed with exit code 1

however, the error output also reports the following flags for the linker

-mmacosx-version-min=10.7 -L/usr/lib -lGLEW.1.7.0 -lglfw -framework OpenGL -framework Cocoa

and indeed, libGLEW.1.7.0 does reside in /usr/lib

Moreover, if I try to build the program by hand, with

  gcc -L/usr/lib -lGLEW.1.7.0 main.cpp

I get an a.out file without any errors reported (which if run causes a segmentation fault, but maybe that’s to be expected)

Any ideas on what might be causing XCode to produce this error and how it could be avoided?

  • 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-27T10:50:00+00:00Added an answer on May 27, 2026 at 10:50 am

    (I have removed this from an edit to the question and posted it as an answer, as per leppie’s suggestion)

    I might have found the answer in some details I had considered unimportant in my original post. So here goes, in case others might encounter a similar problem.

    Apparently, XCode4 projects use clang++ by default, which in the link phase accepts a parameter -isysroot (which apparently ld does not accept).

    Now, if in your build settings (as was my case) your Base SDK has been defined as something other than Current Mac OS, the parameter -isysroot will be introduced with the value of a directory pointing to that SDK, thus (this is my guess) prepending this to all other lib directories you might be including with -L.

    In my case, -L/usr/lib was effectively turning into -L/Developer/SDKs/MacOSX10.7.sdk/usr/lib which does exist and did not contain libGLEW, hence the error “library not found”

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

Sidebar

Related Questions

#include<iostream> #includeGlew\glew.h #includefreeGlut\freeglut.h using namespace std; int main(int argc, char* argv[]) { GLint ExtensionCount;
I'm trying to use VBO in my OpenGL project. I'm using glew library for
I am trying to experiment using basic shaders in my program, I came across
I've been using OpenGL extensions on Windows the painful way . Is GLEW the
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Im having an issue using GLUT with monodevelop. Im using the following code: #include
I'm trying to use PhysFS in my C++ game (using a C++ wrapper )
Using gcc and ld on x86_64 linux I need to link against a newer
I have an OpenGL-program using GLSL, that I can run just fine with the
Using SolrNet for querying & faceting. I have a combination of int, tdate and

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.