Hello Radu,

While working on a project generated on my own that uses chrono api, I'm 
facing the same issue as Chris.
I'm using VS 2022 on Windows to build the project and have modified the 
"Working Directory" as you mentioned above to $(OutDir) and have my data 
folder in the directory of .exe as well as in my src.
I'm right now trying to set the absolute path in the 
target_compile_definitions of CMakeLists.txt for "CHRONO_DATA_DIR" but 
running into some parsing issues while building.
What approach should I take?

Thanks,
Shubhankar

On Friday, May 26, 2017 at 8:56:56 AM UTC-4 Radu Serban wrote:

> When you run from *within *Visual Studio, you must properly set the 
> "Working Directory"  which is by default $(ProjectDir):
>
>    - right click on your project (the demo you want to debug/run using F5 
>    or Ctrl+F5) in the Solution Explorer, select Properties 
>    - go to 'Configuration Properties->Debugging' 
>    - change 'Working Directory' to $(OutDir) 
>
> Unfortunately, this property is not stored in the Visual Studio project 
> files, so there is no way to set it through CMake.
>
> --Radu
>
> On 5/26/2017 2:13 PM, lz shu wrote:
>
> Hi Radu, 
>
> Thanks for your timely reply and exhaustive explanation. First of all, 
> what I'm talking about are the demos provided with Chrono. 
>
> After CMake configuration,  I compiled Chrono(ALL_BUILD) on Visual Studio 
> 2013 on both debug mode and release mode without any change. And actually, 
>  the data files were automatically copied under <chrono_build>/bin/data/. 
> However, when I used debug mode(F5) to run a specific demos on Visual 
> Studio, it told me those warnings just like Chris'. 
>
> So, I thought the data files must be lost on the relative path, and when I 
> copied the data files on those two paths(<chrono_build>/src/demos/data
>  and <chrono_build>/src/demos/data/vehicle/data), it loaded fonts and 
> texture successfully, and demos that the files' name beginning with 
> demo_IRR or demo_VEH could display normally. 
>
> Still, I don't know why it works.
>
> So, I'd appreciate any information you could give me.
>
> Sincerely,
> LZ Shu
>
>
> 在 2017年5月26日星期五 UTC+8下午5:11:01,Radu Serban写道: 
>>
>> Hi LZ,
>>
>> The Chrono data directory should be copied automatically at CMake 
>> configuration time from the source tree into the build tree, under 
>> <chrono_build>/bin/data/ (Windows) and <chrono_build>/data/  (Linux).   
>> What you did works because the default is for all Chrono demos to look for 
>> data files with a relative path ../data/ (and, on Windows binaries are 
>> created in <chrono_build>/bin/Release/, <chrono_build>/bin/Debug/, etc., 
>> depending on the build type, while on Linux all binaries are created in 
>> <chrono_build>/bin/).
>>
>> Can you check if the data files are in the above location in the build 
>> tree?
>>
>> One last question: are you talking about the demos provided with Chrono 
>> not being able to find the data files?  Or are you talking about your own 
>> project that links to Chrono?
>>
>> --Radu
>>
>> On 5/26/2017 3:20 AM, lz shu wrote:
>>
>> Hi Chris, 
>> I had the same problem on windows, and a forcible way for solving this is 
>> put the data dir on the following directories:
>> 1.  Chrono_build/src/demos/vehicle
>> 2. Chrono_build/src/demos
>> This may not be the best way but the simplest one. And it works. I think 
>> it is the same on linux.
>> Thanks,
>> lz
>>
>> 在 2016年11月20日星期日 UTC+8上午2:46:58,Chris Kees写道: 
>>>
>>> Hi,
>>>
>>> I always get these sorts of warnings when running the demos:
>>>
>>> Could not load font because the file does not exist: 
>>> ../data/fonts/arial8.xml
>>> Could not open file of texture: ../data/logo_chronoengine_alpha.png
>>> Could not open file of texture: ../data/skybox/sky_lf.jpg
>>> Could not open file of texture: ../data/skybox/sky_dn.jpg
>>> Could not open file of texture: ../data/skybox/sky_up.jpg
>>> -
>>>
>>> I hacked my tutorial setup to properly find the data dir, but I'm 
>>> wondering if there's a way to fix this at the cmake configuration phase or 
>>> with an environment variable. My install root is  ./linux2 so the demos are 
>>> in ./linux2/bin and the data is in ./linux2/share/data.
>>>
>>> Thanks,
>>> Chris
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "ProjectChrono" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
> You received this message because you are subscribed to the Google Groups 
> "ProjectChrono" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/projectchrono/55042f60-01f8-41cb-9aaf-b80d9b2f36d2n%40googlegroups.com.

Reply via email to