Setting up SAMPGDK in C++
#1

I've followed RyDeR`'s tutorial on how to create a plugin to set up my C++ 2010 Express for SA-MP scripting. After I've followed all the steps everything works smoothly, but now I want to be able to call the SA-MP functions inside C++, for which I've downloaded ZeeX's SAMPGDK. I've executed the installer and installed it.

Now my question is - what else do I have to do to make the natives work in C++? Simply installing doesn't seem to be everything. How do I load the files into my C++ project? What do I have to include?

I've read the README.txt on the github page, but it doesn't really help me since all it actually says is "Install the .exe and do rest of the stuff to make it work".


Thank you in advance.
Reply
#2

  1. If your using visual studio, when you open your project press ALT + F7.
  2. You will see a dialog with a list.
  3. In the list click on c/c++ to drop down a menu.
  4. Click on general.
  5. On the right hand side you should see Additional Include Directories.
  6. Click that and a drop box will appear, click on edit
  7. A new dialog will appear.
  8. Now on the new dialog add a path and navigate to .../sampgdk3.0.2/includes/ (click includes thats the path you need)
  9. Apply the new settings.
Now include the libraries, and use it.

Код:
#include <sampgdk/a_samp.h>
#include <sampgdk/a_players.h>
This will add sampgdk to your project. There will be a way to add the include path globally for all projects but i cant remember how.
Reply
#3

bump, I'm still wanting to know and iggy1's way didn't work. I installed sampgdk but I can't get include any files: #include <sampgdk/a_samp.h>. It still errors me, not sure why and how I can install it. I wish there were was a installation readme...
Reply
#4

bump
Reply
#5

I forgot to mention that you also need to add an object library to your solution. It's in the sa-mpgdk directory.

Right click on your solution in the solution explorer.
Click Add > Add existing item.
Navigate to *sampgdk directory/lib/sampgdk3 and add this lib.


If you followed the previous steps, and then this one you should have it working w/o errors/warnings.

Let me know if you want me to upload a blank version for you.

EDIT: Lorenc if your only having trouble adding additional directories to be included you should look at visual studios documentation.

http://msdn.microsoft.com/en-us/libr...=vs.71%29.aspx
Reply
#6

Thanks a lot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)