Hello everybody!
I am new to Astra camera and I’m trying to learn the basics by using Visual studio 2019 and studying the SDK user guide.
I have downloaded the SDK and extracted it to a folder names ASTRA_HOME and I put it in the folder “repos” where all my visual studio’s projects are located.
I have runned all the samples exes and everything is fine.
Now, I have created a new project and in the main.cpp file I have written the code below as the guide writes.
#include <astra/astra.hpp>
#include <cstdio>
#include <iostream>
int main(int argc, char** argv)
{
astra::initialize();
// what will go here? you'll find out soon!
astra::terminate();
std::cout << "hit enter to exit program" << std::endl;
std::cin.get();
return 0;
}
but I get LNK2019 errors and I guess that I don’t write the path for lib files with the proper way.
At first, I had also problem with the astra.hpp file but when I changed the path of the directory I solved it.
Generally, the way that the user guide is written doesn’t help me a lot.
Could anybody help me with this?
Thank you in advance.
Sure I can help. Take a look at my VS Project’s config:
These were the project parameters I had to change so it would compile and run.
Hope that helps.
Hello Henorique and thank you for your help!
When I use the path $(ASTRA_HOME)include; I get more errors, because the astra.hpp is not recognised, but when I use the below path, this problem doasn’t exist.
By using your parameters I get the below error
and if I write first the astra.lib and not astra_cre.lib in additional dependences field it will give error about the astra.lib.
I guess the probelm is the location I store the project. Where should I store the project whenn I create it?
Woah, that seems really strange. In my setup, ASTRA_HOME is an environment variable (i think that’s the way it should be configured actually, pretty much like JAVA_HOME when you’re using java stuff).
Take a look at my env:
AstraSDK is the folder where I’ve extracted the compressed SDK you can find on this Download Astra SDK 2.1.3 for Visual Studio 2015 64-bit.
Consider the architecture you’re building to (x86 or x64), that makes a lot of difference. I’m using VS2019 and building for x64.
And regarding to the project location, there should be no difference when you properly configure the compiler and linker directories, and the input libraries, at least in my experience.
(i also use user/source/repos for my stuff )
Hope that helps.