I'm trying to get OpenSceneGraph set up on visual studio so I can run through some tutorials and I believe my issue is that I do not know how to correctly set up the environment on visual studios and get the program to look at the library files correctly.
The code in question is just for a osg smart pointer demonstration
#include <osg/ref_ptr>
#include <osg/Referenced>
#include <iostream>
using namespace std;
class MonitoringTarget : public osg::Referenced
{
public:
MonitoringTarget(int id) : _id(id)
{
cout << "Constructing target " << _id << endl;
}
protected:
int _id;
virtual ~MonitoringTarget()
{
cout << "Destroy " << _id << endl;
}
};
int main()
{
osg::ref_ptr<MonitoringTarget> target = new MonitoringTarget(0);
cout << "Reference count before referring: "
<< target->referenceCount() << endl;
osg::ref_ptr<MonitoringTarget> anotherTarget = target;
cout << "Referenced count after referring: "
<< target->referenceCount() << endl;
}
If I point to osgd.lib in Properties->Linker->additional dependencies this will build but when I try to run it a system error occurs whereby it states the program cannot start because "osgd.ll is missing from your computer", however if I point to osgd.dll it will fail to build and throw up the following error: "LNK1107 invalid or corrupt file: cannot read at 0x378 OSG1 C:\Users\Monkone\source\OpenSceneGraph-3.6.3-VC2017-64-Debug\bin\osgd.dll"
What am I doing wrong here?