Solved it with:
#ifdef __linux
#include <unistd.h>
std::string getexepath()
{
char result[ PATH_MAX ];
ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX );
return std::string( result, (count > 0) ? count : 0 );
}
std::string DirName(std::string source)
{
source.erase(std::find(source.rbegin(), source.rend(), '/').base(), source.end());
return source;
}
#endif
call it from main();
std::string;
asd = getexepath();
asd = DirName(asd);
So string asd now have path to executable without executable name
so sf::Texture texture have become:
sf::Texture texture;
if (!texture.loadFromFile(asd + "Data/again/cb.bmp"))
{
return 1;
}
And it works. Thank you for your help guys. Will work on windows and mac version of #define and will post code here, so if somebody needs it can use it