Thread: Dependencies : How do I add them to my library?

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    7

    Dependencies : How do I add them to my library?

    I'm new to these forums and programming, but it's something that I have always been enamored by and have started to transform my ideas to a programmable reality. I have been working with visual studio 2010 and trying to work with sample code but I'm having problems understanding how to add dependencies...

    I'm following some good instructions, but my brain doesn't seem to comprehend what exactly I should be doing??

    Instructions : Getting Started - OpenKinect

    For the life of me, I'm having the hardest time finding out where to place the files from the dependencies... I have all the tools needed for a project, but little direction.. I have the libusb-win32, pthreads-win32 and GLut files along with C-make and visual studio. So with the instructions provided above, how do I add the dependencies to my project? Any help would be "GREATLY" appreciated !
    Attached Images Attached Images Dependencies : How do I add them to my library?-instructions-jpg 

  2. #2
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    You can unpack them anywhere you like. Look at the CMake screenshot on the page you linked for an example on how to configure the paths.

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    7
    Quote Originally Posted by _Mike View Post
    You can unpack them anywhere you like. Look at the CMake screenshot on the page you linked for an example on how to configure the paths.
    First and foremost, thank you for replying. I truly understand the learning power received from having a hungry mind and being apart of a great forum.

    I have each folder unzipped on my desktop, but im confused as to what I am suppose to do at this point?

    For instance, to configure for MS Visual Studio 2010, use /lib/msvc/libusb.lib as the libusb library path in cmake (LIBUSB_1_LIBRARY)

    For instance, to configure for MS Visual Studio 2010, use /lib/pthreadVC2.lib


    Do I do this in CMake like in the example picture using libusb, psthread, and glut?


    please help a beginner if you can....

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Quote Originally Posted by Reece Allen View Post
    Do I do this in CMake like in the example picture using libusb, psthread, and glut?
    Yes. First select where the source for libfreenect is and where to build the library, check the boxes for 'Grouped', and 'Advanced'.
    Then click 'Configure', select your compiler, and wait while cmake does it's thing.
    You will most likely get an error because it can't find the libraries that you downloaded..
    Expand the groups for each of the dependencies and configure the paths..
    <libname>_INCLUDE_DIR is the directory where the header files are. Most often called simply 'include'
    <libname>_LIBRARY is the .lib file

    Then click configure again. If you did everything correct nothing should be red and it should say "Configuring OK", then click 'Generate' and if there are no errors go to the directory you selected as build dir and open the .sln in visual studio and then you should be able to build the solution.

  5. #5
    Registered User
    Join Date
    Jun 2011
    Posts
    7
    Quote Originally Posted by _Mike View Post
    Yes. First select where the source for libfreenect is and where to build the library, check the boxes for 'Grouped', and 'Advanced'.
    Then click 'Configure', select your compiler, and wait while cmake does it's thing.
    You will most likely get an error because it can't find the libraries that you downloaded..
    Expand the groups for each of the dependencies and configure the paths..
    <libname>_INCLUDE_DIR is the directory where the header files are. Most often called simply 'include'
    <libname>_LIBRARY is the .lib file

    Then click configure again. If you did everything correct nothing should be red and it should say "Configuring OK", then click 'Generate' and if there are no errors go to the directory you selected as build dir and open the .sln in visual studio and then you should be able to build the solution.
    Thank You! I followed your instructions and they worked! Wish there was some type of rep to credit you for helping.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Wish there was some type of rep to credit you for helping.
    Such as the "Like" link at the bottom right corner of each post....
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    7
    Compiling
    Now that the project is configured, open libfreenect.sln from your output folder and build it with Visual Studio. Then look for your compiled files in /bin and /lib
    I opened libfreenect.slin from my output folder and tried to build with Visual Studio.
    I navigated to my libfreenect folder and found my compiled files, but where should I copy them to install them? /windows/system32 ?

    When I build the solution I come up with 19 errors and 2653 warnings and I assume an unsuccessful build..any suggestions from the error jpeg below
    Attached Images Attached Images Dependencies : How do I add them to my library?-error-jpg 

  8. #8
    Registered User
    Join Date
    Jan 2010
    Posts
    412
    Quote Originally Posted by Reece Allen View Post
    Compiling
    Now that the project is configured, open libfreenect.sln from your output folder and build it with Visual Studio. Then look for your compiled files in /bin and /lib
    I opened libfreenect.slin from my output folder and tried to build with Visual Studio.
    I navigated to my libfreenect folder and found my compiled files, but where should I copy them to install them? /windows/system32 ?
    Either system32 (or syswow64 if you're on 64-bit windows) or to the same dir as the exe file using them is in.
    My choice would be the exe dir, as it would make redistributing your app much easier without having to hunt down dependency dlls from system32.

    When I build the solution I come up with 19 errors and 2653 warnings and I assume an unsuccessful build..any suggestions from the error jpeg below
    Looks like it fails to link against libusb so my guess is you selected the wrong lib file in cmake.
    You can fix it by adding the right library to the linker settings of which ever project libusbemu.cpp is in.
    Or if you haven't made any changes to the code that you want to keep you can just try running cmake again.
    Last edited by _Mike; 06-18-2011 at 06:24 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Makefile dependencies
    By taurus in forum C Programming
    Replies: 1
    Last Post: 11-09-2008, 12:17 AM
  2. C app with all dependencies
    By bradleyd in forum C Programming
    Replies: 4
    Last Post: 05-19-2007, 11:47 PM
  3. Dependencies
    By spank in forum Windows Programming
    Replies: 4
    Last Post: 08-14-2006, 03:51 AM
  4. C++ library dependencies on compilers
    By danglingelse in forum C++ Programming
    Replies: 1
    Last Post: 03-31-2006, 11:42 PM
  5. functional dependencies
    By DMaxJ in forum C++ Programming
    Replies: 10
    Last Post: 10-23-2002, 07:07 AM