Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML2 static linking with mingw32: undefined references.  (Read 16853 times)

0 Members and 1 Guest are viewing this topic.

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
SFML2 static linking with mingw32: undefined references.
« Reply #15 on: August 17, 2011, 07:08:39 pm »
Hey, I was having similar problems when I using a newly compiled static build of sfml 2 and using SFML-STATIC got rid of most of them, but, now i have 3 left
Code: [Select]

sfml-system-s.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<wchar_t>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (__imp_?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z)
1>sfml-system-s.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: wchar_t __thiscall std::ctype<wchar_t>::widen(char)const " (__imp_?widen@?$ctype@_W@std@@QBE_WD@Z)
1>sfml-system-s.lib(String.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char __thiscall std::ctype<wchar_t>::narrow(wchar_t,char)const " (__imp_?narrow@?$ctype@_W@std@@QBED_WD@Z)


any idea why String is giving me issues?
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 static linking with mingw32: undefined references.
« Reply #16 on: August 17, 2011, 09:07:19 pm »
Make sure that wchar_t is defined as a native type in the C++ options of your project.
Laurent Gomila - SFML developer

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
SFML2 static linking with mingw32: undefined references.
« Reply #17 on: August 18, 2011, 06:49:29 am »
double checked, seems as though it already is :(
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 static linking with mingw32: undefined references.
« Reply #18 on: August 18, 2011, 08:03:39 am »
Which compiler are you using?
Laurent Gomila - SFML developer

WitchD0ctor

  • Full Member
  • ***
  • Posts: 100
    • View Profile
    • http://www.teleforce-blogspot.com
SFML2 static linking with mingw32: undefined references.
« Reply #19 on: August 18, 2011, 08:04:38 am »
Visual Studios 2010, compiling as 32 bit
John Carmack can Divide by zer0.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML2 static linking with mingw32: undefined references.
« Reply #20 on: August 18, 2011, 08:07:13 am »
Did you leave the STATIC_STD_LIB CMake option disabled when you built SFML? Which CRT option do you use in your project?
Laurent Gomila - SFML developer

Gez

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML2 static linking with mingw32: undefined references.
« Reply #21 on: June 15, 2012, 11:51:38 pm »
I have the same problem so I figured it'd be okay to use the same thread, even if it is an old one?

Quote
1>Linking...
1>sfml-system-s.lib(String.cpp.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<wchar_t>::_Getcat(class std::locale::facet const * *,class std::locale const *)" (__imp_?_Getcat@?$ctype@_W@std@@SAIPAPBVfacet@locale@2@PBV42@@Z)

The IDE and compiler used is good old VC++ Express 2005.

Project settings that might be relevant:
Quote
Multi-threaded DLL (/MD)
__cdecl (/Gd)
Compile as C++ Code (/TP)

/O2 /Oi /D "WIN32" /D "USE_SFML_RENDERWINDOW" /D "__WXMSW__" /D "_WINDOWS" /D "NOPCH" /D "_CRT_SECURE_NO_WARNINGS" /D "_CRT_SECURE_NO_DEPRECATE" /D "GLEW_STATIC" /D "SFML_STATIC" /D "NDEBUG" /D "UPDATEREVISION" /D "_UNICODE" /D "UNICODE" /GF /FD /EHsc /MD /Gy /Fo"Release\\" /Fd"Release\vc80.pdb" /W3 /nologo /c /Zi /TP /errorReport:prompt

And yes, wchar_t is treated as a built-in type.

This is using the SFML 2.0 RC I downloaded from the official site yesterday (SFML-2.0-rc-windows-32-vc2008.zip from 14 June 2012); so I didn't build SFML myself. Can this be caused because it was apparently compiled with MSVC++ 2008? It'd be the first time I'd see such an incompatibility between both versions though.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: SFML2 static linking with mingw32: undefined references.
« Reply #22 on: June 16, 2012, 09:32:33 am »
2005 and 2008 are not compatible, you must recompile SFML.
Laurent Gomila - SFML developer