Since moving to LLVM, C++ code won't find files at relative paths
<p>In short my question is: 
Does LLVM require C++ to use absolute paths to files, where GCC did not?</p>

<p>I have an code project I did for my degree, I reopened it recently as I wanted to use it in an app I was doing at a hack day.
However when running it I was getting a bad access exception.</p>

<p>After some digging around I traced the problem back to a line that references an XML file and runs some parsing on it if it's open.
After hacking around a bit I found that I could no longer just refer to the file by it's relative location (everythings at the same level in the app directory. I had to use a call on the local platform (in this case iOS) to get the absolute path and use that.</p>

<p>Here's a snippet of the code thats affected:</p>

<pre><code>char* BaseBarcode::getXMLToParse( string *fileTitle ) //Safely get the XML file into a c_string
{
char *ft = new char[ fileTitle-&gt;length( ) + 1 ];
strcpy( ft, fileTitle-&gt;c_str( ) );
ifstream xmlfile ( ft, ios::in );

vector&lt;string&gt; xmlcontent;
string xmlentry;
string xmltoparse;

if ( xmlfile.is_open( ) )                           //open the file
{
    while ( getline( xmlfile, xmlentry ) )          //get the data
    {
        xmlcontent.push_back( xmlentry + "\n" );    //add data to vector
    }
    xmlfile.close( );

    for ( int i = 0; i &lt; xmlcontent.size( ); i++ )  //iterate through vector into string
    {
        xmltoparse += xmlcontent[ i ];
    }
}

char * cxml = new char [ xmltoparse.size( ) + 1 ];  //copy string into cstring
strcpy ( cxml, xmltoparse.c_str( ) );

return cxml;
}
</code></pre>

<p>As you can see the filename is passed in, and in the normal case is, in this example "Basic.xml".
However To make it work I need to pass in the absolute path which is some crazy long path. Otherwise it fails the is_open test.
Ultimately this isn't a huge problem, but....</p>

<ol>
<li>I don't want to have to make it dependent on platform</li>
<li>I wanna know why!</li>
</ol>
