Forum Discussion
BalinKingOfMori
10 years agoHonored Guest
Visual Studio 2013 Linker Errors
I'm using VS2013 Pro with the DK2 SDK, and I'm getting the following linker errors: Error 1 error LNK2001: unresolved external symbol "public: static struct ovrHmdDesc_ const * const Globals::hmd" (...
kojack
10 years agoMVP
"BalinKingOfMoria" wrote:
Is it really necessary to download Community or Express instead of Professional? How different can they be?
Professional is around $1000+.
Community is pretty much the same as professional, but free.
Express is also free, but has limits.
Express is the old crap style of free visual studio, community is the new way that is much better. But if you already (legally) have professional, there's no benefit to community.
For the errors...
Linker errors for unresolved external symbol mean the linker was looking for something defined in an object file (the temp file generated from a cpp) but couldn't find it. This means the thing is declared (it's in a header somewhere or has a prototype) but the actual implementation is missing. The errors say they are looking for Globals::hmd and Globals::resolution. So it knows about both of these, but can't find where they were actually allocated.
struct Globals
{
public:
static ovrHmd hmd;
static ovrSizei resolution;
};
Ok, two static members of a struct.
Here's the problem. Static members of a struct (or class) need to have their storage defined somewhere. Here in the header they are declared, so all the code knows what type they are, but you haven't actually created them somewhere in a cpp. You need to add this in a cpp file:
ovrHmd Globals::hmd;
ovrSizei Globals::resolution;
This is also where you can give them initial values.
Whichever cpp you add that to will allocate space for them in it's generated obj file. That's what the linker was searching for.
Don't put that bit in a header, otherwise every cpp that includes the header will try to generate it's own storage for the statics, resulting in name conflicts.
"dignifiedweb" wrote:The api isn't deprecated or renamed.
Renaming Direct X SDK to "Windows 8.1 SDK" is very confusing when all the docs don't call their API deprecated...
There used to be two primary sdks: the directx sdk (which stopped in june 2010, the last stand alone one you can download) and the windows platform sdk (contains heaps of stuff for other parts of windows).
The directx sdk was merged into the windows platform sdk.
One negative of this is that microsoft also decided to get rid of the direct3d9x library (note the x on the end), which provided stuff like vector and matrix classes. Any program that uses parts of d3d9x will fail to build with just the windows sdk.
Luckily you can still install the june 2010 directx and everything works fine like it used to.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 7 years ago
- 7 months ago