开发者

How to open a file in solution directory in Visual Studio c++?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜