开发者

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

开发者 https://www.devze.com 2023-03-17 16:20 出处:网络
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 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

精彩评论

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

关注公众号