Different behaviour building on Linux and Windows.
I am using a SQLite database in a Qt app and it works fine building on both windows and linux. Running it from Qt Creator works fine on both machines but if I execute the binary directly it doesn't find the database on linux but does on windows.
Code:
db.setDatabaseName("db/database.sqlite");
Also, when I build on windows the binary is located at <projectdir>/debug or <projectdir>/release depending on which build config I use but on Linux it's always located at <projectdir>.
Why is it like that? Shouldn't Qt Creator handle paths relative to the project in the same manner on both platforms?
Re: Different behaviour building on Linux and Windows.
Quote:
Originally Posted by
newstead
Why is it like that? Shouldn't Qt Creator handle paths relative to the project in the same manner on both platforms?
No, the path is defined by your used OS. And this is also the reason why your database once get found and other time not. That's the disadvantage of relativ paths...
Have a look at the wiki: Current working directory
Re: Different behaviour building on Linux and Windows.
Okay, I get that. But still, why doesn't Creator work with debug and release directorys on Linux when it does on Windows? It would be convienient if the tool had the same behaviour on different platforms... :)