#include <stdio.h>
#include <SFML\Window.h>
extern sfWindow* sfWindow_Create();
int main()
{
sfWindow* window;
sfVideoMode vmode =
{
.width = 1280,
.height = 720,
.bitsPerPixel = 32
};
sfContextSettings csettings =
{
.depthBits = 24,
.stencilBits = 8,
.antialiasingLevel = 2,
.majorVersion = 3,
.minorVersion = 3
};
window = sfWindow_Create(&vmode, "TEST", sfClose, &csettings);
getchar();
return 0;
}
clang -I "[truncated]\CSFML-2.0-rc\include" -c -v ..\test.c -o ..\test.obj
link /OUT:..\test.exe /NOLOGO /LIBPATH:"[truncated once more]\CSFML-2.0-rc\lib\msvc" /DEFAULTLIB:csfml-window /DEFAULTLIB:libcmt /DEFAULTLIB:csfml-main /DEFAULTLIB:csfml-system ..\test.obj /VERBOSE
test.obj : error LNK2019: unresolved external symbol _sfWindow_Create referenced in function _main
..\test.exe : fatal error LNK1120: 1 unresolved externals
/DEFAULTLIB:csfml-main /DEFAULTLIB:csfml-systemThat's not how you're supposed to link libraries. Just put them on the linker command line with no specific switch.
I tried it now and it appears to be doing the exact same thing. Failing as well.Quote/DEFAULTLIB:csfml-main /DEFAULTLIB:csfml-systemThat's not how you're supposed to link libraries. Just put them on the linker command line with no specific switch.
Why do you declare the function? It's declared in the CSFML headers.extern sfWindow* sfWindow_Create();
LINK is doing its job, because everything works with sfWindow_Create() commented out.But it fails with any other CSFML function, right?
If I don't, it gives me warnings. Doesn't work as well with that line deleted.QuoteWhy do you declare the function? It's declared in the CSFML headers.extern sfWindow* sfWindow_Create();
Yup. Seems to fail only with functions. Could it be the compiler or me compiling it wrong?QuoteLINK is doing its job, because everything works with sfWindow_Create() commented out.But it fails with any other CSFML function, right?
If I don't, it gives me warnings.Which ones?
QuoteIf I don't, it gives me warnings.Which ones?
implicit declaration of function 'sfWindow_Create' is invalid in C99
(Don't think I should care about this one)incompatible integer to pointer conversion assigning to 'sfWindow *' (aka 'struct sfWindow *') from 'int'
By the way, your own declaration is wrong, the parameters are missing.
Which version of CSFML are you using?2.0-rc, the 'official' one (don't know if it's the correct term).
unresolved external symbol "public: static struct sf::Shader::CurrentTextureType sf::Shader::CurrentTexture"
(?CurrentTexture@Shader@sf@@2UCurrentTextureType@12@A)
referenced in function _sfShader_setCurrentTextureParameter
2.0-rcNames have changed, all functions are lowerCamelCase now. So for example it's sfWindow_create.
It's just the graphics lib that doesn't compile, gives one errorYou mean, with the latest sources?
Names have changed, all functions are lowerCamelCase now. So for example it's sfWindow_create.Wow, just wow. It works. Thank you very much!
You mean, with the latest sources?Yes.