I'm having trouble linking the GLEW library to my Xcode Project - c

I'm currently trying to follow the OpenGL intro guide here. I've pulled the finished project straight from the git repo on the site into a new Xcode project, but upon trying to build and run I get a "GL/glew.h: No such file or directory".
I've downloaded glew from the site, and run "make" and "make install". I can see 3 libGLEW files in /usr/lib, and 3 header glew related header files in /usr/include/GL. This all leads me to believe it's installed fine.
Following a couple of ideas from googling, I tried adding the /usr/lib and /usr/include/GL paths to the relevant search paths in the project info, but that still gave the same problem. I also tried adding "-lGLEW" to the 'Other Linker Flags' option.
The include in the C source is simply
#include <GL/glew.h>
What am I missing?!
Thanks for any help
Accepted answer works, the recursive box in XCode also needs to be checked.

If you #include it using #include then the search path has to be simply /usr/include. Try adding /usr/include to your header search paths in your Xcode project and then it should be able to find the header.

Related

Compiling with SDL in different directories

I'm trying to do a project which uses SDL2 to do the graphics.
I want to have my project files in a directory.
I have the functions that manipulate the SDL directly and pictures in a subdirectory of this (UI_library).
I solved the compiling part by adding to the compilation commands
-LUI_library
The problem is that when I run the program, it can't find the pictures, since it assumes they are in the project directory and not in the subdirectory.
Do you know how to fix this without manually changing the code in the subdirectory? There are a lot of references to the pictures in the library.
One way to solve this problem would be addressing the whole path to your file.
For Example:
Windos:
SDL_LoadBMP("C:\Documents\your_image.bmp")
Linux:
SDL_LoadBMP("/home/tigre200/Documents/your_image.bmp")

relative path and system paths are not working in codeblocks

When I am trying to access files from standard usr/ it is not working. and showing errors that file is missing .
I have added path but and make it work but i think this is not the correct way.
I have a workspace with 10-12 projects which are of c and cpp both.
In one project I am using cpp with thrift libraries and protocol.
in that project only I am facing issue. with I am individually building that project it is working but when building it from the main project. it starts showing error in files.
There all almost 17 projects and 16 are generating .so files and all are going to the main project. and main is generating an executable. and that executable uses all the .so files.
but In thrift only it is showing errors. before it was showing for #include i added that file so now it is showing undefined type Name Space ..
I think this issue is because of relative path but I am not sure
Please Help

I'm struggling with SDL2 installation on Xcode 6

I'm working on a little project and I'm trying to use SDL2 library! I installed the SDL2.framework successfully in my library/framework folder. Then when I tried to link my headers and my framework in Xcode by adding the Library/Framework path for the framework and /Library/Framework/SDL2.framework/Headers for the headers in my app settings! Then I include
. #include
Afterward when I run the program there is an error but not about the fact it doesn't find headers.
Do you guys have a few tips about this?
Thank you
PS : sorry for the eventual English mistake
edit: i finally manage to run the program (i forgot to link binary) but now Xcode shut down right after it
I finally could install it for those who are struggling with this !
1. Download SDL2 source code on the website.
2. Compile the framework and copy SDL2.framework in the Library/Framework directory.
3. Create a classic Xcode project in C. In build settings. Then in Build Phases add SDL2.framework in the "Link binary with libraries" Indicate for the headers search paths : Library/Frameworks/SDL2.framework/Headers and Library/Frameworks for the framework search paths.
Hope this can help some of you.
Thank you all for the help !
try the following tutorial to see if it helps - http://zamma.co.uk/setup-sdl2-in-xcode-osx/

Integrating Tapku Library to XCode 4.6 project

Its been a long since I am struggling integrating the Tapku Library in my Xcode project. I want to implement the Day View component from Tapku into my project. I followed the instructions from read-me on github but had no success. I am getting following error, "Apple Compiler LLVM Error" when I add the files to my project. Anyone who has successfully integrated the same please help.
I solved this issue by using Finder (before opening xCode) copy the src folder to my projects directory.
So my project structure is MyProject/Frameworks/src
For the rest of the steps just follow the guide on Tapku's GitHub page.
Only add the 2 TapkuLibrary.xcodeproj and src/TapkuLibrary.bundle files
Select the Build Phases
Link Binary With Libraries
For the Header Search Path you can use $(SRCROOT)/Frameworks/src remember to use non-recursive option
And for Other Linker Flags add -ObjC
Hope this helps

Using GTK+ And Xcode4

So I've installed GTK-OSX from http://gtk-osx.sourceforge.net/
I've added my /location-to-GTK/lib directory to Xcode's header search path. But exactly which library files do I add to my Xcode project? There are about ~100 of them and I don't think need to add all of them.
Can anyone with GTK-OSX experience assist me?

Resources