I would like to open a file in the solution direc开发者_开发技巧tory so that whenever i move the whole project file, It'll work.
I'm currently using code ! as shown below and when i tried to use code 2, it fails. How do i do this?
Code 1:
IplImage *src=cvLoadImage("C:\\Documents\\Visual Studio 2008\\Project1\\ABC.jpg"); //A function that load image
Code 2:
`IplImage *src=cvLoadImage("$(SolutionDir)/ABC.jpg"); //A function that load image
You could use
"..\\example.txt"
that will find the file on top project directory.
Also doesn't cvLoadImage
takes 2 argument! I assuming you are using OpenCV
精彩评论