Actually i use a dll to export some methods to a unmanaged application.
I need to create a static var for the sf::Texture, but when i try, the dll is not correctly initialized.
I just add this line:
static Texture test3;
And the dll stop.
Actually i use a dll to export some methods to a unmanaged application.
I need to create a static var for the sf::Texture, but when i try, the dll is not correctly initialized.
I just add this line:
static Texture test3;
And the dll stop.
Regarding the effects of "static" as qualifier, those are covered in other answers. If you want to use "static" then you should know what "static" is doing.
I don't know what you are trying to achieve, but I think you may want to access that value through functions defined in your DLL.
In example
source.cpp
static Texture *myInternalTexture;
void InitInternalTexture(){
myInternalTexture = new Texture( blah);
}
Texture *GetInternalTexture(){
return myInternalTexture;
}
void ReleaseInternalTexture(){
delete myInternalTexture;
}
Depending on your use you may prefer to access a reference of your texture or do a copy, I don't know what you need to do. In case you can easily adapt the code above to work with your Texture type.