Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How do I setup a SDK in C++? (http://www.chiefdelphi.com/forums/showthread.php?t=150177)

team-4480 17-08-2016 18:48

How do I setup a SDK in C++?
 
Hi!

We just received our Cooler Master keyboard and are already excited to start programming different effects(Thanks Cooler Master!). The problem right now is the setup. Cooler Master has an SDK which has a .dll, .lib, and a .h file. I am pretty sure that I have to #include the .h file in the main.cpp file, but that throws a bunch or errors because I am pretty sure I need to do something with the other two files. What exactly am I supposed to do with the .dll and .lib files? I am not super familiar with C++ but aside from the setup, it appears like any other language I've used. I am using Visual Studio 2013.

Thanks a bunch in advance!

Rachel Lim 17-08-2016 19:17

Re: How do I setup a SDK in C++?
 
I'm guessing you meant visual studio 2013 since as you said, the keyboard is programmed in c++ ?

I included stdafx.h, Windows.h, and SDKDLL.h (they need to be in that order or I get a bunch of errors for reasons I don't understand). The .dll and .lib files do have to be in the same folder as the project files (same with targever.h and stdafx.cpp).

Let me know if that isn't working. I'm using visual studio 2015 but I think it should work in the same way.

team-4480 17-08-2016 23:36

Re: How do I setup a SDK in C++?
 
Quote:

Originally Posted by Rachel Lim (Post 1601536)
I'm guessing you meant visual studio 2013 since as you said, the keyboard is programmed in c++ ?

I included stdafx.h, Windows.h, and SDKDLL.h (they need to be in that order or I get a bunch of errors for reasons I don't understand). The .dll and .lib files do have to be in the same folder as the project files (same with targever.h and stdafx.cpp).

Let me know if that isn't working. I'm using visual studio 2015 but I think it should work in the same way.

Yes, I meant Visual Studio :o

I tried what you said and it did indeed work! I was starting to pull my hair out! Thanks for your help!

euhlmann 18-08-2016 00:32

Re: How do I setup a SDK in C++?
 
For future reference:

.h files contain function / class definitions for your code to use. So, you need to include the .h file for the compiler to know what you mean when you call a library function

.dll (dynamic) and .lib (static) library files contain the actual code for the library. The linker needs these to make your program actually run library functions when you make those calls. Basically, the .dll/.lib is the actual library and the .h tells you what's in the library.

.dll or dynamic libraries are added in whenever you run your program (so you'll need those in the same folder as your program or on the search path for it to run correctly), while .lib or static libraries are added to your program binary during compilation (so no external dependencies).

For your project, you'll only need either the .dll or .lib, depending on which type of library linking you want.

Hope this clears things up


All times are GMT -5. The time now is 09:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi