GLEW and GLFW on Mac OS X (standalone) - xcode

I built a project on XCode using glew and glfw. The CMake file was given to me by a tutorial, so I don't actually know how to make one of the cpp files build by itself. When I pasted the code into a new standalone file, I got the errors:
error: GL/glew.h: No such file or directory
error: glfw3.h: No such file or directory
I googled these errors, but most of the solutions were for Linux and did not work for my Mac. GLEW and GLFW are indeed installed on my system, since I was using them successfully in my XCode project. I just don't know how to set the correct paths when I am compiling a standalone cpp file at the command line using g++.

use -I at the command line to indicate which include paths the compiler should search

Related

Library not found OpenCV

I'm on mac 10.7.5, using xcode 4.6.2 and working with the OpenCV 2.4.3 library. I went through the process of making the build directory with the cmake files in terminal and did the download.
I added the .dylib files in Xcode and changed the header path, changed C++ Library to libstdc++, but when I compiled I got this error :
ld: library not found for -lopencv_calib3d.2.4.3
clang: error: linker command failed with exit code 1
I have libopencv_calib3d.2.4.3.dylib added in the project so I have no idea what else it needs.Any ideas?
If your "make back-end" is Cmake you should stick to using it. Local config changes in Xcode can "secretly" be overwritten when the cmake is rerun (which for example happens after you make changes to it) creating weird build errors and forcing you to remember all the manual changes you made.
Your problem seems to be that the generated project doesn't seem to know where to look for opencv.
Assuming you installed opencv using macports you should add a line saying
link_directories(/opt/local/lib)
to your CMakeLists.txt. (if you installed it using brew, or compiled it manually just replace /opt/local/lib for /usr/local/lib or the path to your compiled libraries)
Also make sure to link against opencv_calib3d instead of opencv_calib3d.2.4.3 (unless you have a very particular reason for bypassing this, but that usually means that something else is weird in the setup :) )
Final pointer that you might already know of: As you are already using Cmake you should add the libraries to link against using TARGET_LINK_LIBRARIES(...) in Cmake rather than manually adding them in Xcode (referring to my previous argument).

issues with freeglut on mac os snow leopard (it builds fine via macports)

im on mac os snow leopard gcc 4.5.4 | gcc 4.2.1, trying to build the tutorials http://www.arcsynthesis.org/gltut/
one needs to build dir glsdk first. I install freeglut (prerequisite) via macports freeglut #2.8.0_1 (active) and manually copy and paste its lib and include folders in dir glsdk so that
ls ..../Tutorial_0_3_8/glsdk/freeglut -> include lib
(I couldn't build the freeglut provided that's why I replace it with the one from macports)
after fixing many errors (mostly due to legacy snippets included) I'm testing the build in Test dir and when I try to run the generated executable ./TestD, I get:
X Error of failed request: BadRequest (invalid request code or no such operation)
Major opcode of failed request: 34 (X_UngrabKey)
Serial number of failed request: 28
Current serial number in output stream: 28
what's this? a bit of search suggests this is a driver's problem(?)..
when I use glut with other gl code it runs just fine
my X11 is broken** and this seems to be the problem.
since it's tricky to build this set of tutorials, I repeat the steps I followed for anyone facing similar trouble
get the source https://bitbucket.org/alfonse/gltut/downloads, untar and fill in the gaps so that you have Tutorial_0_3_8 instead of Tutorial 0 3 8
in glsdk directory, comment out --"freeglut/freeglut.lua, in premake4.lua
in glsdk directory, ./premake gmake and then make config=release
in framework directory, framework.cpp, manually replace macros LOCAL_FILE_DIR & GLOBAL_FILE_DIR with "./data/" "./data/" & "../data/" respectively and comment out #include "directories.h"
build all the tutorials in a single step from root or those that you need, e.g. in Test directory put the right paths to include for freeglut headers and link with the:
in Test.make replace -I../glsdk/glutil/include and -L../glsdk/glutil/lib with paths from freeglut build via macports. Also in the same makefile link with -lglut instead of -lfreeglut
**dyld: Symbol not found: __cg_DGifGetLine
Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /opt/local/lib/libGIF.dylib
in /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO

qmake gives code 3 when attempting to configure qt for static building

I have the latest Qt SDK. I'm trying to configure it for static building with VS2010 (dynamic linking works fine) I have it at this location: C:\QtSDK\Desktop\Qt\4.8.0\msvc2010
When I go there with the VS2010 command prompt and try to run configure -static, or configure -static I get some output but in the end it fails with
Generating Makefiles...
WARNING: c:\QtSDK\Desktop\Qt\4.8.0\msvc2010\projects.pro:44: Unable to find file
for inclusion src\src.pro
WARNING: c:\QtSDK\Desktop\Qt\4.8.0\msvc2010\projects.pro:46: Unable to find file
for inclusion doc\doc.pri
Reading C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/tools
Reading C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/translations/translations.pro
Reading C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/examples
Reading C:/QtSDK/Desktop/Qt/4.8.0/msvc2010/demos
Qmake failed, return code 3
Please help
I downloaded the source zip file instead of trying to work with what came in the SDK and it's working now. Just download the source from here, unzip it, and run the configure.exe in the unzipped folder. My guess (although I have inspected this) is that there's missing source files or other resources in the SDK version.

Compiling cvblob on OSX does not correctly locate OpenCV libs

I'm having issues with CVBlob locating the OpenCV installation on OSX 10.6. I have patch for the osx install as described in an earlier message on the cvblob wiki. When I run make, the build process immediately complains that it cannot find cv.h or highgui.h and then subsequently fails to locate additional symbols and vars declared in those headers.
The cmake command I am using is :
cmake -DOpenCV_DIR=/usr/local/Cellar/opencv/2.3.1a/ .
I can see that cv.h is contained in the includes directory in that location. I also tried the following cmake command where I specify the location of the OpenCV Cmake info:
cmake -DOpenCV_DIR=/usr/local/share/OpenCV/ .
Neither seems to correctly tell the cvblob installation where OpenCV is located.
Please help!
SR
In later versions of cvBlob, openCV is automatically located. But version 0.10.4 and before expects the openCV directory to be located next to the cvblob directory. Specifically, version 0.10.4 seems to expect the opencv-2.4.9 directory to be next to cvblob. In this version of cvBlob, the -DOpenCV_DIR parameter seems to have no effect on OS X, and this was the only way I could get it working.
Are you working with Xcode?
If so, just add the OpenCV-path to your header search path in your Xcode project.

Fltk1.1 with MinGw?

I have a project that compiles in linux and I am now trying to compile it under MinGw in Windows 7. The project includes the fltk library. When I try to compile, I get the message that the FL/Fl.h file is not found -
GUIWindow.h:5:18: fatal error: FL/Fl.H: No such file or directory
compilation terminated
I downloaded the fltk 1.1 files and extracted them to my desktop. I went into the directory, configured, and compiled the files successfully. So what am I missing here to get this to install? I thought that with #include<>, if the library is installed correctly that it will find the files no matter where they are at. So what else is necessary under MinGw? Any help is appreciated.
Okay well I just cut the FL folder from the fltk folder and put it in MinGw/include. This compiles. If anyone can explain why just having #include works in linux but not in MinGw, I would be grateful.

Resources