Project
+-- Debug (contains *.exe)
| +-- data => Project\data
+-- Release
| +-- data => Project\data
|
+-- data (contains *.png)
where both Project\Debug\data, and Project\Release\data are "symlinks" (junctions) to Project\data.
In such situation it's impossible to load resources (images) from Project\Debug\data or Project\Release\data, because defaultDataPath() builds wrong path.
The problem lies in code:
join returns correct path like X:\...\Project\Debug\data/, while boost::filesystem::canonical seems to be trying to expand the path to something like X:\...\Project\Debug\Project\Debug\data, which is completely incorrect.
This is a known issue in boost::fs (see https://svn.boost.org/trac10/ticket/10900 and https://svn.boost.org/trac10/ticket/11138), which seems to be fixed at the main branch.
Consider following directories structure:
where both
Project\Debug\data
, andProject\Release\data
are "symlinks" (junctions) toProject\data
. In such situation it's impossible to load resources (images) fromProject\Debug\data
orProject\Release\data
, becausedefaultDataPath()
builds wrong path. The problem lies in code:join
returns correct path likeX:\...\Project\Debug\data/
, whileboost::filesystem::canonical
seems to be trying to expand the path to something likeX:\...\Project\Debug\Project\Debug\data
, which is completely incorrect. This is a known issue inboost::fs
(see https://svn.boost.org/trac10/ticket/10900 and https://svn.boost.org/trac10/ticket/11138), which seems to be fixed at the main branch.Tested with released version 0.10.1.