error in including GLAUX.h in Eclipse - opengl

I am a newbie in OpenGL.
I am using Eclipse to do some OpenGL examples, but I can't include glaux.h in my file.
Eclipse always gives a warning that it can't find this library.
So, how can I import this library into Eclipse?

Would this thread help?
You should add the include path for the external library.
In Project Properties->C/C++ General->Paths and Symbols, go to the Includes tab.
Add the path for C (and C++ if your header contains C++ elements).
Once you pass this error, check out the blog post "Was trying my hands at openGL...".

Do you have the libraries on your system? If not please download gluax.h from http://www.songho.ca/opengl/files/glaux.h and gluax.lib from http://www.songho.ca/opengl/files/glaux.lib.
Set the path and you are done.

Related

How can I install and use C++ libraries on eclipse?

I want to use libosmium library. Could someone please tell me how do I set up this library after I download it?
All I need to know is the standard way of installing external libraries. I can't really find very clear instructions online.
I'm coding with C++ using the eclipse IDE version 4.18.0.
For includes: right click on your project and go to Properties>>C/C++ Build>>Settings>>GCC C++ Compiler >> Includes
you must add the include path for the external library (where the header reside). This information is needed by the Eclipse indexer (code completion etc.) and the compiler
For libraries: right click on your project and go to Properties>>C/C++ Build>>Settings>>GCC C++ Linker >> Libraries you must add the library search path (option -L) and the library you want to link against (option -l). This info is needed for the linker.
Source: http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_add_an_external_library_to_my_C.2B.2B_project.3F
Eclipse-CDT Setting Pictures
Include path settings:
Library & library search path settings
You can also use pkg-config plug in
https://marketplace.eclipse.org/content/pkg-config-support-eclipse-cdt
Here is a link to a similar question with answers: Problems importing libraries to my c++ project, how to fix this?
As specified in the other answer, you can usually add a library by looking at the project properties:
Properties>>C/C++ Build>>Settings>>GCC C++ Compiler>>Includes
However if you're using a makefile project, the Makefile itself must know about the location of libraries. In this case, in order to avoid an "Unresolved inclusion" warning in the header, you may also want to tell eclipse where the header files are. This way the autocomplete & "Open Declaration" will work. This is found in:
Properties>>C++ General>>Preprocessor Includes Paths, Macros etc.
In my case I couldn't figure out how to add a custom configuration and updated the default configuration. I added a path for the Android NDK under the GNU C++ -> CTD User Setting Entries

Using ITK with xcode

I am working on an xcode project that requires me to use ITK (a c++ library), I have went through with the installation of ITK, by doing
ccmake InsightToolkit-4.13.1
and then configuring and generating the files, then runing
make
make install
but I do not know how to import the library into the xcode project, where I get the following error every time I try building it:
'itkImage.h' image file not found
I would like to know how could I import it and share it with other people on different computers.
The #include directive comes with two flavors:
With quotes (#include "file.h")
With ankle brackets (#include <file.h>)
The first usually refers to files relative to your project directory. The second is for system libraries.
You can influence the search path in the project setting:
double-click on the project in the project explorer
Click on Build settings
Click on your target
Click on All to view also hidden options
In the section Search Paths you can then update the header search path to include the absolute path of you rlibrary headers. Attention: you have to do this for the Debug and for the Release builds:
This will solve the error that you have reported.
Remark: be careful, because after this is solved, you could experience some other issues related to the good use of the library, as pointed out by drescherjm in the comments (link about registration of custom classes to the library's fatories if Cmake is not used to compile the project)

"Include can't be found", how to fix it?

I am developing using OpenSceneGraph. I installed it from a user-runnable installer.
When I try to compile an application using OpenSceneGraph, I have this error :
Lexical or preprocessor error : Include cannot be found for all <osg/*> includes like <osg/AnimationPath>.
The file is available here /Library/Frameworks/osg.framework/Versions/92/Headers/XXXX So following this solution on how to "add existing frameworks" to the new Xcode, I added osg.framework to the project.
any idea is a welcome.
I am using :
IDE Xcode 4.5
Clang 4.1
OS X Mountain Lion
When compiling you will have to add the include files using the -I option of the compiler and also possibly add library directory using the -L option of the compiler(the options may be a bit different if you are using compiler different from gcc).
I guess both library and the include directories for this product should be subdirectories of the install destination you have chosen. For the include directory of course look for directories containing some kind of header files .h or .hpp and for the libraries look for .lib or .dll doesn't the library documentation mention what includes and libraries you need and where you can find them?
EDIT: you will also have to tell xcode where to search for your includes. I tried googling it and here is one of many results on how to add a directory to the include path of a project.
You will have to located which directory to add to the include path. It seems they set some environment variables in the official documentation for that.
Hope this helps.
You'll need to add /Library/Frameworks to the "Frameworks search path" in the project settings.

setup include path in eclipse CDT in mac os (headers from framework)

for example I need to include a header
#include <OpenGL/glext.h>
while it is actually a header file glext.h under OpenGL.framework/Headers/.
Therefore it is no way to give eclipse a physical path about "OpenGL/glext.h", and I always get unresolved inclusion warning.
I can still build and run them (with managed makefile project) but it is impossible to browse the functions or definitions from those "resolved" header files.
is there any solution?
While not ideal, my solution to this has been to create a folder "/Developer/Framework Headers" (though the name isn't important), and link from e.g. "/System/Library/Frameworks/Foo.framework/Headers" to "Foo" under said folder. Then in Eclipse I add "/Developer/Framework Headers" to a project's includes.
I say not ideal because apart from having to create links for the frameworks you need and add an include to each project, Eclipse seems to have trouble in certain cases such as nested frameworks (e.g. CoreGraphics beneath ApplicationServices), but YMMV.
Yes there is one. Right click on the project in "Project Explore" window and click on the "property". In there Open "C/C++ General" column and choose "Path and symbols". Now you see all of the include library path for this project. If your using C then add the OpenGL library into GNU C, or if you use C++ then add it into GNU C++. Unfortunately you have to do this for every new project. I have been searching for a while how to do this by default but nothing really useful. Hope this help you get rid of those annoying yellow wave lines.
Since current Eclipse CDT releases don't perform sub-framework header inclusion correctly, you can avoid sub-framework problems (like those generated by the CoreServices header files) by creating symbolic links to the include directories of each sub-framework. I elaborated on this subject, which stems from danhan answer on this question, in this blog post.
In order to automate this process, I've created a Z shell script which automates this process and creates the symlink to the specified frameworks' header directory, together with the links to the include directory of each one of their sub-frameworks. The script can be found in this GitHub repository.
Hope this helps.

C++ Library Include

I am relatively new to C++ and need to use a library for the first time.
I was hoping someone would be able to show me how to properly [ link to / include ] the library.
The library I want to use is the ID3 v3.8.8 that can be found here:
http://id3lib.sourceforge.net/
I have downloaded the Windows binaries and now just need a way to link to the library.
Files downloaded: Debug/id3lib.dll, Debug/id3lib.lib, Debug/id3lib.exp, Release/id3lib.dll, Release/id3lib.lib, Release/id3lib.exp
I am using Visual Studio 2010.
Any help is greatly appreciated. Thanks in advance.
Before you can do any C++ development with this library you'll need the headers too which are in the id3lib-3.8.3.zip file. You have only downloaded the binaries which will let you run an application that needs those libraries but not re-compile it.
There are several steps, and many a pitfall. If you are a rank newbie at using C++ and VC++ in particular, every step is going to require some (gasp) reading of documentation or googling.
In VC++ 2010, use the Property Manager "C/C++ General / Additional Include Directories" section if necessary to tell the compiler how to find the header-files.
Use the Property Manager "C/C++/ Code Generation / Runtime Library" section if necessary to tell the compiler what version of the Microsoft C Runtime Library the library requires.
Use Property Manager "Linker / Input / Additional Dependencies " to specify the .lib file id3lib.lib.
Use Property Manager "Linker / General / Additional Library Directories" to tell the linker where to find .lib file.
If the dll id3lib.dll is not in the directory where you will start your program, open a Microsoft Explorer window, and right-click on "My Computer." Select "Properties/Advanced/Environment Variables", and edit the user-variable PATH to contain the path of the directory that contains the dll. Be very careful doing this. Before you change it, copy the value that's there originally and save it to a text file, in case you mess up and need to restore it. If you get it wrong, other programs can fail to start.
Good luck.
Add id3lib.lib to your project, that should satisfy the linker and the resulting executable will depend on id3lib.dll.