#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    28
    Rep Power
    0

    Libraries, SDK's


    I'm thinking of starting to get more into C or C++ since I'm getting more into electronics and hardware. But I'm having a difficult time learning libraries and SDK's. I don't even know where to begin installing them, can anyone help me with this?

    Let's say I want to build a Spotify app using the Spotify C API , how would I begin after I downloaded libspotify?
  2. #2
  3. No Profile Picture
    I haz teh codez!
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2003
    Posts
    2,549
    Rep Power
    2337
    Well -- and this is just me -- but I'd start with the links in this section on the page you linked:

    Documentation

    The API documentation is available online. The libspotify distribution also contains the documentation, as well as a few code examples. There is also an FAQ available.
    :rolleyes:
    I ♥ ManiacDan & requinix

    This is a sig, and not necessarily a comment on the OP:
    Please don't be a help vampire!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    28
    Rep Power
    0
    Originally Posted by ptr2void
    Well -- and this is just me -- but I'd start with the links in this section on the page you linked:



    :rolleyes:
    I'm not talking about using libraries, I need to know how to use them in my projects, installing. When using PHP it's just adding the .php files to your project.
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,184
    Rep Power
    2222
    You simply tell your linker to include that library file. And you #include the library's in the source files in which you want to use the library.

    In general in Windows, you will get three kinds of files: a header file (.h), a static library file (.lib), and a dynamically linked library file (DLL, as a .dll). The actual functions that you want to use are in the DLL. But writing code to use a DLL is cumbersome, involving function pointers, etc, so they provide wrapper functions in the static library file that access the DLL for you. So then the general model is that you build your executable which links in the static library at compile time and then your program will use the DLL at run-time.

    Now, about explaining to you how to link that static library into your project. I'm sorry, but we cannot do that. In fact, it's impossible for us to tell you that. The reason is because you have not told us what IDE you're using. The details are different in each IDE (integrated development environment, what most people call a "compiler", though the compiler is only one small component of an IDE). In a GUI IDE, somewhere there are project options or properties and somewhere among those options or properties there is one which lists the static libraries to be linked in. Find that option/property and add your new library to it.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    28
    Rep Power
    0
    Originally Posted by dwise1_aol
    You simply tell your linker to include that library file. And you #include the library's in the source files in which you want to use the library.

    In general in Windows, you will get three kinds of files: a header file (.h), a static library file (.lib), and a dynamically linked library file (DLL, as a .dll). The actual functions that you want to use are in the DLL. But writing code to use a DLL is cumbersome, involving function pointers, etc, so they provide wrapper functions in the static library file that access the DLL for you. So then the general model is that you build your executable which links in the static library at compile time and then your program will use the DLL at run-time.

    Now, about explaining to you how to link that static library into your project. I'm sorry, but we cannot do that. In fact, it's impossible for us to tell you that. The reason is because you have not told us what IDE you're using. The details are different in each IDE (integrated development environment, what most people call a "compiler", though the compiler is only one small component of an IDE). In a GUI IDE, somewhere there are project options or properties and somewhere among those options or properties there is one which lists the static libraries to be linked in. Find that option/property and add your new library to it.
    I guess I'll just wait till after my finals to start coding C, thanks for the information though.
  10. #6
  11. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,184
    Rep Power
    2222
    Well, when you return later with the same question, be sure to tell us what compiler and IDE you're using so that somebody can answer your question.

IMN logo majestic logo threadwatch logo seochat tools logo