| | |
Avoiding Millions of Additional Dependencies
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2009
Posts: 5
Reputation:
Solved Threads: 1
Hi, I am pretty new to C++ but have lots of experience in java/c# and know the basics (classes/structures/pointers etc) but am having some problems linking to external source libraries.
I am trying to use something called the openframeworks which I have downloaded and I need to include "\libs\openFrameWorks\ofMain.h" but when I do this it complains about all the includes that that file links to (which are in subdirectories of openFrameWorks folder) and I have to add a dependency to every subdirectory in the library.
Is there a better way of doing this, I understand that you cant automatically add all subdirectories but my Additonal Dependencies list is getting stupidly long.
Thanks in advance, sorry for being noobish
I am trying to use something called the openframeworks which I have downloaded and I need to include "\libs\openFrameWorks\ofMain.h" but when I do this it complains about all the includes that that file links to (which are in subdirectories of openFrameWorks folder) and I have to add a dependency to every subdirectory in the library.
Is there a better way of doing this, I understand that you cant automatically add all subdirectories but my Additonal Dependencies list is getting stupidly long.
Thanks in advance, sorry for being noobish
I'm not sure which compiler you're using, but usually you'd register any 3rd party libraries with your compiler.
e.g. In Visual Studio 2003 you'd:
In the Solution Explorer, right click on your project and select 'properties'.
In the property pages, select the 'C/C++->General' item in the tree.
Now select the 'Additional Include Directories' in the form and click on the '...' button. This will bring up a dialog which will allow you to add the path to the include folder of your library.
To do this, click on a blank line in the list (or add one using the folder icon and then select it). Next select the '...' button and use the popup dialog to navigate your way to the libraries include folder.
So that's the first part, the headers for your library are registered with the IDE. Next you need to ensure that the linker knows where to find the precompiled library files (usually found in the lib folder).
To do this, select 'Linker->General' in the tree and select the 'Additional Library Directories' item in the form and click on the '...' button that appears to bring up the 'additional library directories' dialog. As with the 'additional header directories' dialog, select a blank line (or add one using the folder icon and then select it) and use the '...' button to navigate to the lib directory for your library.
That done, click OK on all of the open dialogs and that's it! Your library is registered with the IDE.
Now in your project you should be able to use the library without having to add loads and loads of includes into your code. You'll only need to include the main header/headers for the library instead of every single one of them. And you'll be able to declare them like:
Instead of:
Which I assume is more or less how you're currently using them!
The instructions I've included are for VS2003, but the steps should be similar for 2005 and 2008.
If you're using any other IDE, you'll have to refer to the manual for your compiler. Most compilers nowadays have the ability to register additional headers/libraries in this way.
Hope this has helped,
Cheers for now,
Jas.
e.g. In Visual Studio 2003 you'd:
In the Solution Explorer, right click on your project and select 'properties'.
In the property pages, select the 'C/C++->General' item in the tree.
Now select the 'Additional Include Directories' in the form and click on the '...' button. This will bring up a dialog which will allow you to add the path to the include folder of your library.
To do this, click on a blank line in the list (or add one using the folder icon and then select it). Next select the '...' button and use the popup dialog to navigate your way to the libraries include folder.
So that's the first part, the headers for your library are registered with the IDE. Next you need to ensure that the linker knows where to find the precompiled library files (usually found in the lib folder).
To do this, select 'Linker->General' in the tree and select the 'Additional Library Directories' item in the form and click on the '...' button that appears to bring up the 'additional library directories' dialog. As with the 'additional header directories' dialog, select a blank line (or add one using the folder icon and then select it) and use the '...' button to navigate to the lib directory for your library.
That done, click OK on all of the open dialogs and that's it! Your library is registered with the IDE.
Now in your project you should be able to use the library without having to add loads and loads of includes into your code. You'll only need to include the main header/headers for the library instead of every single one of them. And you'll be able to declare them like:
C++ Syntax (Toggle Plain Text)
#include<"yourlibraryheader.h">
C++ Syntax (Toggle Plain Text)
#include<"C:\path\to\library\yourlibraryheader.h">
The instructions I've included are for VS2003, but the steps should be similar for 2005 and 2008.
If you're using any other IDE, you'll have to refer to the manual for your compiler. Most compilers nowadays have the ability to register additional headers/libraries in this way.
Hope this has helped,
Cheers for now,
Jas.
Last edited by JasonHippy; Aug 11th, 2009 at 8:05 am. Reason: smelling pistakes and pytos! heh heh!
There are 10 types of people in this world.....
Those who understand binary .....
And those who don't!
Those who understand binary .....
And those who don't!
![]() |
Similar Threads
- POSIX lib and MS Visual Studio 2005 (C++)
- This application has failed to start becuase the application configuration is incorre (C++)
- linker error: uafxcw.lib (C++)
- Prob with DirectX (C++)
- !!!!!!!!!!! (C++)
- Unresolved External Errors (C)
- Problems linking libs, I think... (C)
- how to use a vs2005 app on non-development PC (C++)
- OpenGL in VC++ 2005 (C++)
- Randomize number with OpenGL (C++)
Other Threads in the C++ Forum
- Previous Thread: need help to store coordinates in vector array
- Next Thread: cmd from cpp
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





