Friday, October 31, 2008

MinGW "ln -s"

I just spent about an hour looking for a problem that didn't exist, and it is all due to the fact that "ln -s" doesn't do what I expected it to in Msys/MinGW. I have an project that uses plugins for most of the UI and assumes that the plugins reside in a specific directory (./plugins in the application directory). Most of the time I use a cross-compiler so I don't have to leave linux land. When developing in windows, with release/debug targets, I link the plugin directory to the release directory that my plugins are compiled in (ln -s plugins/release plugins). The only reason plugins have ever not loaded was due to them missing some flags during link, or when one of my plugins has the same name as a core library that I use (only because the dll's aren't prefixed with "lib" like they are in linux). Anyway, some plugins were not loading, and I couldn't figure out why--trying of course the obvious aforementioned problems. As it turned out, the linked plugin directory was not being updated with the newly compiled plugins, meaning the minor changes that I made, which would have resulted in valid plugins, were not being used. Anyhow, I spent far too long on this until realizing that the sym link was not a sym link at all.

No comments: