Debug issues

25 views
Skip to first unread message

alan....@solent-renegades.co.uk

unread,
May 19, 2021, 9:24:21 AM5/19/21
to ProjectChrono
Hi, I have a quick question regarding debugging chrono, it seems that when I try to debug examples which load resources in, they fail to load, saying file not found?  This is in regards to a fresh build of Chrono 4.0, so I haven't changed any properties.

Many thanks,
Alan.

Konstantin Korsakov

unread,
May 20, 2021, 3:05:49 AM5/20/21
to ProjectChrono
Hi,

for me this was a solution:

Configure chrono path somewhere before the system initialization code

int main(int argc, char *argv[]) {
// Set path to Chrono data directory
SetChronoDataPath(R"(D:\ProjectChrono\data\)");

Alan Weaver

unread,
May 20, 2021, 4:30:38 AM5/20/21
to projec...@googlegroups.com

Hi,

Thanks for your advice but it didn't work.  I just don't understand why the resources are loaded on Release and Debug build when running the exe but not when debugging?  I've checked the properties settings and they are the same for release as it is in debug in visual studio, this is why I've had to come on here for advice, because it all looks okay and I don't feel we should be changing any settings.

Many thanks,

Alan.

--
You received this message because you are subscribed to a topic in the Google Groups "ProjectChrono" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/projectchrono/1NQc_hRoWP4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/d2efece0-ba72-4e93-a64f-faf174ba3b84n%40googlegroups.com.

Radu Serban

unread,
May 20, 2021, 4:41:36 AM5/20/21
to Alan Weaver, projec...@googlegroups.com

Hi Alan,

 

This is an issue when running from *within* Visual Studio, whether you hit F5 (“Start debugging”) or Ctrl-F5 (“Start without debugging”), and has to do with the “Working Directory” property of the project (in this case the VS project of whichever demo you are trying to debug).  

 

More recent versions of CMake provide a mechanism to properly set this at configuration time and so the latest Chrono code will automatically take care of this for you.   However, this was not available at the time we released Chrono 4.0.

 

The solution is simply to go in the Properties of the demo VS project, go to ‘Debugging’ and change ‘Working Directory’ from $(ProjectDir) which is likely what it is right now to $(OutDir).

 

Best,
--Radu

 

P.S.  I strongly encourage you to update to the latest version of Chrono!

--
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 projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/8f05c9f3-b652-2a0f-00a9-7027bb310350%40solent-renegades.co.uk.

 

Alan Weaver

unread,
May 20, 2021, 4:57:19 AM5/20/21
to projec...@googlegroups.com

Hi Radu,

Yes I just managed to figure it out just before your advice, I changed the Working directory to OutDir and it all worked!  I can now debug the terrain code.

I will update to the newer version once I have found a decent version of Eigen in c#, so in the mean time I've been porting Chrono4 into Unity3D and using the ChMatrix class for now.

Many thanks,
Alan.

Reply all
Reply to author
Forward
0 new messages