Jump to content
  • Advertisement
Sign in to follow this  
silverphyre673

New issue - getting PSDK to work correctly

This topic is 4518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[EDIT]: There is a new issue. After installing PSDK for MSVC++ to the directory MSVC++/PSDK, I tried to simply include some of the headers in PSDK. Since I hadn't thought to add them to the path to search for, naturally, the compiler couldn't find them. Since it's 12:30 AM right now, I'm very tired and just cut and pasted them into the MSVC++/VC directory, so now all the headers and .lib files from PSDK are in the same directory with the headers that come with MSVC++ 2005. I have two issues. First, I don't know whether this will actually work or not. Is there going to be some issue, other than that it might have been nice to have them in separate directories (as in, can I still use the PSDK headers without reinstalling it?). Secondly, I'm getting an "unresolved external symbol" error when I try to use MessageBox from windows.h. I'm assuming that this is because I created the project as an "empty project" as opposed to a Win32 project. How do I clear up this problem, and is there a way to do that without making a whole new project? Thanks! [OLD PROBLEM]: I just tried switching to MSVC++ from Dev-cpp, as the title implies, and it's a very nice IDE. I especially enjoy being able to easily step through code! My issue is with including files. In dev-cpp, many headers were included; I didn't have to add anything to the include or lib directory to use, say, the Win32 API. Adding new packages was generally easy; I would download the desired material off devpaks.org and be on my merry way. In MSVC++, I have absolutely no idea how to go about this. If I have to compile files from source to include, I have no idea how to do that. MSVC++ doesn't even come with the win32 API, so I can't even include things like windows.h How do I go about adding new source to include if it wasn't written by me? Thanks a bunch! [Edited by - silverphyre673 on July 3, 2006 2:25:26 AM]

Share this post


Link to post
Share on other sites
Advertisement
The thing you're looking for is PlatformSDK. Download, install, voila!

Although I'm surprised it didn't come with your visual studio distribution, as it came with mine (vs 2003 prof).

Share this post


Link to post
Share on other sites
You are probably using the Express Edition of Visual C++, which does not include the Platform SDK, which would allow you to use the Win32 API, among other things. Instructions for installing the PSDK can be found here.

As for other libraries, you probably want to look at the VC++ include/library directory settings, which can be found under "Tools->Options->Projects and Solutions->VC++ Directories" and select the proper type from the "Show directories for:" drop down.

Can you be more specific about the libraries that you need to compile yourself? In most cases, binaries are already available for your particular compiler, which spares you the trouble of compiling from source.


jfl.

Share this post


Link to post
Share on other sites
Thanks you guys!

jflanglois, there aren't any specific libraries at the moment that I need to install myself at this moment (although SDL and some of its extensions will be needed at some point), but I simply wasn't sure of how to get any needed libraries working, having relied on devpaks this whole time. How do these binaries work?

Share this post


Link to post
Share on other sites
If they come pre-compiled, they will probably be a set of include files, a .lib file, and optionally a .dll file. You would put these in an appropriate place for them, and reference the correct directories in VC++.

As an example, let's say that I have a library called MyLibrary. Your directory tree would look something like this:

C:\Development\Libraries\MyLibrary
    bin
        MyLibrary.dll
    include
        MyLibrary.h
        MyLibraryHelper.h
    lib
        MyLibrary.lib
    src
        MyLibrary.cpp
        MyLibraryHelper.cpp


Then you would go to "Tools->Options->Projects and Solutions->VC++ Directories" and select:
1) "Include files", add a line that points to "C:\Development\Libraries\MyLibrary\include", or wherever you have placed the include files.
2) "Library files", add a line that points to "C:\Development\Libraries\MyLibrary\lib"
3) Optionally, if the library comes with its implementation files, then you can select "Source files", and add a line that points to "C:\Development\Libraries\MyLibrary\src", which would allow you to step through library code.

Now you have set up the library. If you have a project that is going to use this library, you would
1) include the header file(s) in your code where appropriate (e.g. #include <MyLibrary.h>), and
2) reference the correct .lib file. Go to "Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies" and add MyLibrary.lib, separated by a space with other included libraries.
3) If a dll is included in the library, copy it somewhere accessible to your project, usually "My Documents\Visual Studio 2005\Projects\MyProject\MyProject\" (or somewhere in your path, but since this is development, you may prefer to keep dlls separate per-project).

And that should be it. I know it looks rather complicated (and it does seem to be more complicated than Dev-C++), but you shouldn't be doing this every day. If you have a library that is distributed as source, you would first compile it according to instructions that came with the library, and then follow the above steps with the generated library files.

Hope this helps.


jfl.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!