Yes, both were compiled with the same computer, the same IDE and I&#39;ve made sure they were both using the same runtimes.<div><br></div><div> - Thomas</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/11/1 Tai Chi Minh Ralph Eastwood <span dir="ltr">&lt;<a href="mailto:tcmreastwood@gmail.com" target="_blank">tcmreastwood@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Did you compile SDL and PhysFS yourself? It could be that the libraries were built with different runtimes (that is, I&#39;m aware of, one of the common linking-runtime crash issues with MSVC).</div>
<div><br></div><div>Ralph</div><br><div><div><div class="h5"><div>On 1 Nov 2012, at 14:11, Thomas Lokshall &lt;<a href="mailto:thomas.lokshall@gmail.com" target="_blank">thomas.lokshall@gmail.com</a>&gt; wrote:</div><br></div>
</div><blockquote type="cite"><div><div class="h5"><span style="font-family:arial,sans-serif;font-size:13px">I&#39;m attempting to integrate PhysFS with SDL 2.0 (latest from mercurial) and there seems to be a conflict here.</span><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">PhysFS 2.0.3 compiles and runs fine with the test program using Visual Studio 10.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div>

<div style="font-family:arial,sans-serif;font-size:13px">However, as soon as you introduce SDL to the equation, it causes crashes. It compiles fine with no errors.</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">I made a skeleton program to test this:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

/* BEGIN */</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>#include &lt;stdio.h&gt;</div><div>#include &lt;physfs.h&gt;</div><div><br>

</div><div>int main(int argc, char *argv[])</div><div>{</div><div>  PHYSFS_init(argv[0]);</div><div>  getchar();</div><div>  PHYSFS_deinit();</div><div>  return 0;</div><div>}</div></div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">/* END */</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">This program works just fine. However, if you link with SDL and SDLmain and change the code to this:</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>/* BEGIN */</div><div><br></div><div><div>#include &lt;stdio.h&gt;</div><div>#include &lt;physfs.h&gt;</div>

<div>#include &lt;SDL/SDL.h&gt;</div><div><br></div><div>int main(int argc, char *argv[])</div><div>{</div><div>  SDL_Init(SDL_INIT_EVERYTHING);</div><div>  PHYSFS_init(argv[0]);</div><div>  getchar();</div><div>  PHYSFS_deinit();</div>

<div>  SDL_Quit();</div><div>  return 0;</div><div>}</div></div><div><br></div><div>/* END */</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

This will cause the application to crash when it&#39;s calling PHYSFS_init.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">There are a lot of things that seem to go wrong in windows.c</div>

<div style="font-family:arial,sans-serif;font-size:13px">Most of it seems to be related to the API calls and memory allocation.</div><div style="font-family:arial,sans-serif;font-size:13px">It doesn&#39;t matter if SDL is initialized before or after. Just initializing it at all causes PhysFS to crash.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">The first line that fails during init is line 470 of windows.c:</div><div style="font-family:arial,sans-serif;font-size:13px">

wstr = (LPWSTR) __PHYSFS_smallAlloc(psize * sizeof (WCHAR));<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I have a hunch that compiling this on other platforms might be more successful.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Am I just doing something terribly wrong here or is PhysFS incompatible with SDL 2.0?</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">Regards,</div><div style="font-family:arial,sans-serif;font-size:13px">Thomas Lokshall</div></div></div>
_______________________________________________<br>physfs mailing list<br><a href="mailto:physfs@icculus.org" target="_blank">physfs@icculus.org</a><br><a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
</blockquote></div><br></div><br>_______________________________________________<br>
physfs mailing list<br>
<a href="mailto:physfs@icculus.org">physfs@icculus.org</a><br>
<a href="http://icculus.org/mailman/listinfo/physfs" target="_blank">http://icculus.org/mailman/listinfo/physfs</a><br>
<br></blockquote></div><br></div>