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

Author Topic: Having a hard time getting SFML to work with Clang  (Read 11379 times)

0 Members and 1 Guest are viewing this topic.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Having a hard time getting SFML to work with Clang
« on: January 11, 2013, 12:20:45 am »
Hey, so far my project was working perfectly, but I needed to use some C++11 features for at attempt at higher resolution thread sleeping.
So I switched my compiler from LLVM GCC 4.2 to Apple LLVM 4.1.

Got these errors:
Quote
Undefined symbols for architecture i386:
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      PacketID::Client::gpLogin(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in PacketID.o
  "sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)", referenced from:
      PacketID::Server::ppCreatePlayer(ZipPacket*, Map*) in PacketID.o
  "sf::Texture::loadFromFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, sf::Rect<int> const&)", referenced from:
      Map::loadTexture(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in Map.o
  "sf::IpAddress::IpAddress(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      TcpClient::runListener() in TCPClient.o
      UdpClient::start() in UDPClient.o
  "sf::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, sf::IpAddress const&)", referenced from:
      TcpClient::runListener() in TCPClient.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Quick google search revealed that I needed to re-compile the framework with the compiler I want to use. Did so with CMake and Xcode, put the new frameworks and stuff in the correct folders(according to the manual mac install doc) and my application still produces the same error.

So I made a new SFML project from the template and it won't compile with either compilers. It produces the errors:
Quote
In file included from /Users/matthew/Desktop/Test Dylib/Test Dylib/main.cpp:1:
In file included from /usr/local/include/SFML/Graphics.hpp:32:
In file included from /usr/local/include/SFML/Window.hpp:32:
In file included from /usr/local/include/SFML/System.hpp:34:
In file included from /usr/local/include/SFML/System/Err.hpp:32:
In file included from /usr/local/include/boost/tr1/tr1/ostream:16:
In file included from /usr/local/include/boost/tr1/detail/config_all.hpp:151:
In file included from /usr/local/include/boost/tr1/tr1/utility:21:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/utility:125:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__tuple:16:
In file included from /usr/local/include/boost/tr1/tr1/type_traits:22:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:214:46: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <>          struct ____is_nullptr_t<nullptr_t> : public true_type {};
                                             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:343:42: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
                            is_same<_Tp, nullptr_t>::value >
                                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:350:14: error: too few template arguments for class template '__is_function'
    : public __is_function<_Tp> {};
             ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:344:8: note: template is declared here
struct __is_function
       ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:419:46: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
template <> struct _LIBCPP_VISIBLE is_scalar<nullptr_t> : public true_type {};
                                             ^
In file included from /Users/matthew/Desktop/Test Dylib/Test Dylib/main.cpp:1:
In file included from /usr/local/include/SFML/Graphics.hpp:32:
In file included from /usr/local/include/SFML/Window.hpp:32:
In file included from /usr/local/include/SFML/System.hpp:34:
In file included from /usr/local/include/SFML/System/Err.hpp:32:
In file included from /usr/local/include/boost/tr1/tr1/ostream:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:130:
In file included from /usr/local/include/boost/tr1/tr1/ios:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:15:
In file included from /usr/local/include/boost/tr1/tr1/string:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:434:
In file included from /usr/local/include/boost/tr1/tr1/algorithm:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/local/include/boost/tr1/tr1/memory:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:590:
In file included from /usr/local/include/boost/tr1/tr1/typeinfo:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/typeinfo:61:
In file included from /usr/local/include/boost/tr1/tr1/exception:25:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/exception:128:45: error: field has incomplete type 'std::exception_ptr'
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                            ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/exception:123:23: note: definition of 'std::exception_ptr' is not complete until the closing '}'
class _LIBCPP_VISIBLE exception_ptr
                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/exception:128:55: error: expected ';' at end of declaration list
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
                                                      ^
In file included from /Users/matthew/Desktop/Test Dylib/Test Dylib/main.cpp:1:
In file included from /usr/local/include/SFML/Graphics.hpp:32:
In file included from /usr/local/include/SFML/Window.hpp:32:
In file included from /usr/local/include/SFML/System.hpp:34:
In file included from /usr/local/include/SFML/System/Err.hpp:32:
In file included from /usr/local/include/boost/tr1/tr1/ostream:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:130:
In file included from /usr/local/include/boost/tr1/tr1/ios:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:15:
In file included from /usr/local/include/boost/tr1/tr1/string:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:434:
In file included from /usr/local/include/boost/tr1/tr1/algorithm:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/local/include/boost/tr1/tr1/memory:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:1558:20: error: no member named 'memcpy' in namespace 'std::__1'; did you mean 'memcpy'?
            _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
            ~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/string.h:82:7: note: 'memcpy' declared here
void    *memcpy(void *, const void *, size_t);
         ^
In file included from /Users/matthew/Desktop/Test Dylib/Test Dylib/main.cpp:1:
In file included from /usr/local/include/SFML/Graphics.hpp:32:
In file included from /usr/local/include/SFML/Window.hpp:32:
In file included from /usr/local/include/SFML/System.hpp:34:
In file included from /usr/local/include/SFML/System/Err.hpp:32:
In file included from /usr/local/include/boost/tr1/tr1/ostream:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:130:
In file included from /usr/local/include/boost/tr1/tr1/ios:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:15:
In file included from /usr/local/include/boost/tr1/tr1/string:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:434:
In file included from /usr/local/include/boost/tr1/tr1/algorithm:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/local/include/boost/tr1/tr1/memory:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:1586:20: error: no member named 'memcpy' in namespace 'std::__1'; did you mean 'memcpy'?
            _VSTD::memcpy(__end2, __begin1, _Np * sizeof(_Tp));
            ~~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/string.h:82:7: note: 'memcpy' declared here
void    *memcpy(void *, const void *, size_t);
         ^
In file included from /Users/matthew/Desktop/Test Dylib/Test Dylib/main.cpp:1:
In file included from /usr/local/include/SFML/Graphics.hpp:32:
In file included from /usr/local/include/SFML/Window.hpp:32:
In file included from /usr/local/include/SFML/System.hpp:34:
In file included from /usr/local/include/SFML/System/Err.hpp:32:
In file included from /usr/local/include/boost/tr1/tr1/ostream:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ostream:130:
In file included from /usr/local/include/boost/tr1/tr1/ios:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:15:
In file included from /usr/local/include/boost/tr1/tr1/string:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:434:
In file included from /usr/local/include/boost/tr1/tr1/algorithm:18:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
In file included from /usr/local/include/boost/tr1/tr1/memory:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2564:52: error: expected ';' at end of declaration list
    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t) _NOEXCEPT
                                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2743:52: error: expected ';' at end of declaration list
    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t) _NOEXCEPT
                                                   ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2993:45: error: C++ requires a type specifier for all declarations
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t)
                                            ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3001:1: error: 'operator==' cannot be the name of a variable or data member
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x)
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3001:12: error: use of undeclared identifier 'nullptr_t'; did you mean 'nullptr'?
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x)
           ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3001:55: error: expected ';' at end of declaration
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x)
                                                      ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3002:1: error: expected unqualified-id
{
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3760:26: error: expected ';' at end of declaration list
    shared_ptr(nullptr_t) _NOEXCEPT;
                         ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3782:37: error: unknown type name 'nullptr_t'
    template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
                                    ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:3783:51: error: unknown type name 'nullptr_t'
    template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
                                                  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:4028:18: error: qualified reference to 'shared_ptr' is a constructor name rather than a type wherever a constructor can be declared
shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
                 ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

I'm a bit at a loss. I figure I'm doing something quite wrong.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #1 on: January 11, 2013, 08:25:03 am »
I can get Xcode to compile SFML just fine as dylibs but it produces an SH error when I try as frameworks.
Unix NMake compiles both dylibs and the frameworks just fine.

Apparently the only problem is I have no idea how to get those dylibs or frameworks into my Xcode project. And the Xcode template doesn't work for some reason.

I'm gonna give the tutorial another shot before calling it a night.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #2 on: January 11, 2013, 08:34:32 am »
No dice, re-followed the tutorial, used the clang compiler, did the unix make commands and the SFML template still bugs out on me:

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Having a hard time getting SFML to work with Clang
« Reply #3 on: January 12, 2013, 06:03:24 pm »
Don't you have two versions installed on your computer ? one in /usr/local (dylibs) and one in /Library/Frameworks/ ?
SFML / OS X developer

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #4 on: January 12, 2013, 10:57:04 pm »
You are using C++11 ?

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #5 on: January 13, 2013, 02:23:53 am »
Yes to both.

I might just need to purge my system of SFML and do a clean re-install.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #6 on: January 13, 2013, 07:55:37 am »
I've come to the realization, I suck at linking libraries.

I just installed boost from the instructions, then tried to use it in a program. Linker errors. I get linker errors with SFML too....
Perhaps this is a sign that I'm not meant to go. Or it's a challenge from Mr.Destiny wanting to see how I'll overcome it.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #7 on: January 13, 2013, 08:06:14 am »
Suck it Destiny! Just got my test boost program to compile. Turns out I have to add the dylibs to the program. Then set the header search path for the dylibs. Then set the library search path for the lib folder the dylibs are in. Then add the dylibs under "Link Binary With Libraries" in the build phases.

Okay okay, now Imma try this process with SFML.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #8 on: January 13, 2013, 09:19:38 am »
No dice. Here's my errors and settings on the same page:


See anything wrong?


Edit: This is what I get when I try to use frameworks instead of the .a files:
« Last Edit: January 13, 2013, 09:47:07 am by Gan »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Having a hard time getting SFML to work with Clang
« Reply #9 on: January 13, 2013, 01:46:27 pm »
Okay.. I'm lost with all your attempts..

Could you summary, in one post :-), your situation. More specifically, I'd like to know the following :
- what version of SFML are you using
- what settings did you use the compile SFML (if you did it yourself)
- how did you install SFML
- what version of the template are you using (usually, it's the same version as SFML, but you could have installed them manually, so..)
- what are the project settings
- the current compilation errors (btw, you can copy and past them instead of taking a screenshot)
- and, of course, any other information that you think is relevant here

SFML / OS X developer

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Having a hard time getting SFML to work with Clang
« Reply #10 on: January 13, 2013, 09:34:15 pm »
- what version of SFML are you using:
2.0 latest snapshot
- what settings did you use the compile SFML (if you did it yourself):
I followed the tutorial, using CMake and enabling c++11 features using the clang compiler and setting -stdlib=libc++. I'd tried this method with making frameworks, dylibs and .a files. And I have it set to install the xcode template
- how did you install SFML:
I ran sudo make install on the generated makefiles from CMake which should put the compiled libraries in library/frameworks or /usr/local/include and /usr/local/lib
- what version of the template are you using:
I'm using the template version it installed.
- what are the project settings:
For framework, I added the SFML.framework to the project, set it in the Link Libraries, and added "/Library/Frameworks" to the Framework Search Path
- the current compilation errors (btw, you can copy and past them instead of taking a screenshot):
Quote
Ld "/Users/matthew/Library/Developer/Xcode/DerivedData/Game_Server-asxlnfbqgoemzmfmlkbbnxgkxhue/Build/Products/Debug/Game Server.app/Contents/MacOS/Game Server" normal x86_64
    cd "/Users/matthew/Dropbox/Cross Platform Code/Game Server Xcode"
    setenv MACOSX_DEPLOYMENT_TARGET 10.8
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/matthew/Library/Developer/Xcode/DerivedData/Game_Server-asxlnfbqgoemzmfmlkbbnxgkxhue/Build/Products/Debug -F/Users/matthew/Library/Developer/Xcode/DerivedData/Game_Server-asxlnfbqgoemzmfmlkbbnxgkxhue/Build/Products/Debug -F/Library/Frameworks -filelist "/Users/matthew/Library/Developer/Xcode/DerivedData/Game_Server-asxlnfbqgoemzmfmlkbbnxgkxhue/Build/Intermediates/Game Server.build/Debug/Game Server.build/Objects-normal/x86_64/Game Server.LinkFileList" -mmacosx-version-min=10.8 -stdlib=libc++ -fobjc-link-runtime -framework Foundation -framework SFML -o "/Users/matthew/Library/Developer/Xcode/DerivedData/Game_Server-asxlnfbqgoemzmfmlkbbnxgkxhue/Build/Products/Debug/Game Server.app/Contents/MacOS/Game Server"

Undefined symbols for architecture x86_64:
  "sf::TcpListener::close()", referenced from:
      TcpServer::stop() in TCPServer.o
  "sf::TcpListener::accept(sf::TcpSocket&)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::TcpListener::listen(unsigned short)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::TcpListener::TcpListener()", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::RenderStates::Default", referenced from:
      ServerController::draw(sf::RenderWindow*) in ServerController.o
  "sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)", referenced from:
      ServerController::draw(sf::RenderWindow*) in ServerController.o
  "sf::RenderTarget::clear(sf::Color const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::RenderWindow(sf::VideoMode, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, sf::ContextSettings const&)", referenced from:
      _main in main.o
  "sf::RenderWindow::~RenderWindow()", referenced from:
      _main in main.o
  "sf::microseconds(long long)", referenced from:
      TcpServer::runSender() in TCPServer.o
      UdpServer::runListener() in UDPServer.o
      UdpServer::runSender() in UDPServer.o
  "sf::Transformable::setPosition(float, float)", referenced from:
      ServerController::ServerController() in ServerController.o
  "sf::SocketSelector::add(sf::Socket&)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::SocketSelector::wait(sf::Time)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::SocketSelector::remove(sf::Socket&)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::SocketSelector::SocketSelector()", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::Text::setColor(sf::Color const&)", referenced from:
      ServerController::ServerController() in ServerController.o
  "sf::Text::setString(sf::String const&)", referenced from:
      ServerController::draw(sf::RenderWindow*) in ServerController.o
  "sf::Text::Text()", referenced from:
      ServerController::ServerController() in ServerController.o
  "sf::Time::Zero", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::Clock::restart()", referenced from:
      _main in main.o
      ServerController::ServerController() in ServerController.o
      ServerController::logic(float) in ServerController.o
  "sf::Clock::Clock()", referenced from:
      _main in main.o
      ServerController::ServerController() in ServerController.o
  "sf::Color::White", referenced from:
      ServerController::ServerController() in ServerController.o
  "sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)", referenced from:
      _main in main.o
  "sf::sleep(sf::Time)", referenced from:
      _main in main.o
      TcpServer::runSender() in TCPServer.o
      UdpServer::runListener() in UDPServer.o
      UdpServer::runSender() in UDPServer.o
  "sf::Packet::append(void const*, unsigned long)", referenced from:
      ZipPacket::onReceive(void const*, unsigned long) in PacketID.o
      ZipPacket::onReceive(void const*, unsigned long) in TCPServer.o
      ZipPacket::onReceive(void const*, unsigned long) in UDPServer.o
  "sf::Packet::Packet()", referenced from:
      PacketID::Server::gpClientID(Connection*) in PacketID.o
      PacketID::Server::gpUdpConnected() in PacketID.o
      PacketID::Server::gpMap(Map*) in PacketID.o
      PacketID::Server::gpClearBlocks() in PacketID.o
      PacketID::Server::gpTimeLeft(long) in PacketID.o
      PacketID::Server::gpBlock(Block*) in PacketID.o
      PacketID::Server::gpCreateCannon(Cannon*, float, float) in PacketID.o
      ...
  "sf::Packet::~Packet()", referenced from:
      ZipPacket::~ZipPacket() in PacketID.o
      ZipPacket::~ZipPacket() in PacketID.o
      ZipPacket::~ZipPacket() in TCPServer.o
      ZipPacket::~ZipPacket() in TCPServer.o
      ZipPacket::~ZipPacket() in UDPServer.o
      ZipPacket::~ZipPacket() in UDPServer.o
  "sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      PacketID::Server::gpCreatePlayer(Player*) in PacketID.o
  "sf::Packet::operator<<(bool)", referenced from:
      PacketID::Server::gpPlayerInAirUpdate(Player*) in PacketID.o
  "sf::Packet::operator<<(float)", referenced from:
      PacketID::Server::gpBlock(Block*) in PacketID.o
      PacketID::Server::gpCreateCannon(Cannon*, float, float) in PacketID.o
      PacketID::Server::gpCreatePlayer(Player*) in PacketID.o
      PacketID::Server::gpCannonPosUpdate(Cannon*) in PacketID.o
      PacketID::Server::gpPlayerPosUpdate(Player*) in PacketID.o
  "sf::Packet::operator<<(int)", referenced from:
      PacketID::Server::gpCreatePlayer(Player*) in PacketID.o
  "sf::Packet::operator<<(unsigned int)", referenced from:
      PacketID::Server::gpClientID(Connection*) in PacketID.o
      PacketID::Server::gpTimeLeft(long) in PacketID.o
      PacketID::Server::gpBlock(Block*) in PacketID.o
      PacketID::Server::gpCreateCannon(Cannon*, float, float) in PacketID.o
      PacketID::Server::gpCreatePlayer(Player*) in PacketID.o
      PacketID::Server::gpCannonPosUpdate(Cannon*) in PacketID.o
      PacketID::Server::gpPlayerPosUpdate(Player*) in PacketID.o
      ...
  "sf::Packet::operator<<(unsigned short)", referenced from:
      PacketID::Server::gpClientID(Connection*) in PacketID.o
      PacketID::Server::gpUdpConnected() in PacketID.o
      PacketID::Server::gpMap(Map*) in PacketID.o
      PacketID::Server::gpClearBlocks() in PacketID.o
      PacketID::Server::gpTimeLeft(long) in PacketID.o
      PacketID::Server::gpBlock(Block*) in PacketID.o
      PacketID::Server::gpCreateCannon(Cannon*, float, float) in PacketID.o
      ...
  "sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)", referenced from:
      PacketID::Client::ppLogin(ZipPacket*, Connection*, Map*, ServerController*) in PacketID.o
  "sf::Packet::operator>>(bool&)", referenced from:
      PacketID::Client::ppRightArrow(ZipPacket*, Connection*) in PacketID.o
      PacketID::Client::ppLeftArrow(ZipPacket*, Connection*) in PacketID.o
      PacketID::Client::ppUpArrow(ZipPacket*, Connection*) in PacketID.o
      PacketID::Client::ppDownArrow(ZipPacket*, Connection*) in PacketID.o
      PacketID::Client::ppSpaceBar(ZipPacket*, Connection*) in PacketID.o
      PacketID::Client::ppMouse(ZipPacket*, Connection*) in PacketID.o
  "sf::Packet::operator>>(float&)", referenced from:
      PacketID::Client::ppMousePos(ZipPacket*, Connection*) in PacketID.o
  "sf::Packet::operator>>(unsigned int&)", referenced from:
      Networking::processUDPMessage(ZipPacket*, sf::IpAddress, unsigned short) in Networking.o
  "sf::Packet::operator>>(unsigned short&)", referenced from:
      Networking::processUDPMessage(ZipPacket*, sf::IpAddress, unsigned short) in Networking.o
      PacketID::Client::ppUdpPort(ZipPacket*, Connection*, Networking*) in PacketID.o
      PacketID::Client::ppUdpConnect(ZipPacket*, Connection*, Networking*) in PacketID.o
      ServerController::onMessage(Connection*, ZipPacket*) in ServerController.o
  "sf::String::String(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::locale const&)", referenced from:
      ServerController::draw(sf::RenderWindow*) in ServerController.o
  "sf::Thread::launch()", referenced from:
      TcpServer::start() in TCPServer.o
      UdpServer::start() in UDPServer.o
  "sf::Window::close()", referenced from:
      _main in main.o
  "sf::Window::display()", referenced from:
      _main in main.o
  "sf::Window::pollEvent(sf::Event&)", referenced from:
      _main in main.o
  "sf::seconds(float)", referenced from:
      _main in main.o
  "sf::IpAddress::IpAddress(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
      Connection::setUdpAddress(sf::IpAddress) in Connection.o
  "sf::IpAddress::IpAddress()", referenced from:
      UdpServer::runListener() in UDPServer.o
  "sf::TcpSocket::disconnect()", referenced from:
      TcpServer::stop() in TCPServer.o
  "sf::TcpSocket::send(sf::Packet&)", referenced from:
      TcpServer::runSender() in TCPServer.o
  "sf::TcpSocket::receive(sf::Packet&)", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::TcpSocket::TcpSocket()", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::UdpSocket::bind(unsigned short)", referenced from:
      UdpServer::runListener() in UDPServer.o
  "sf::UdpSocket::send(sf::Packet&, sf::IpAddress const&, unsigned short)", referenced from:
      UdpServer::runSender() in UDPServer.o
  "sf::UdpSocket::unbind()", referenced from:
      UdpServer::stop() in UDPServer.o
  "sf::UdpSocket::receive(sf::Packet&, sf::IpAddress&, unsigned short&)", referenced from:
      UdpServer::runListener() in UDPServer.o
  "sf::UdpSocket::UdpSocket()", referenced from:
      UdpServer::start() in UDPServer.o
  "sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)", referenced from:
      _main in main.o
  "sf::SocketSelector::isReady(sf::Socket&) const", referenced from:
      TcpServer::runListener() in TCPServer.o
  "sf::Time::asMilliseconds() const", referenced from:
      ServerController::logic(float) in ServerController.o
      ServerController::getMapTimeLeft() in ServerController.o
  "sf::Time::asSeconds() const", referenced from:
      _main in main.o
  "sf::Clock::getElapsedTime() const", referenced from:
      ServerController::logic(float) in ServerController.o
      ServerController::getMapTimeLeft() in ServerController.o
  "sf::Packet::getDataSize() const", referenced from:
      ZipPacket::onSend(unsigned long&) in PacketID.o
      ZipPacket::onSend(unsigned long&) in TCPServer.o
      ZipPacket::onSend(unsigned long&) in UDPServer.o
  "sf::Packet::getData() const", referenced from:
      ZipPacket::onSend(unsigned long&) in PacketID.o
      ZipPacket::onSend(unsigned long&) in TCPServer.o
      ZipPacket::onSend(unsigned long&) in UDPServer.o
  "sf::Window::isOpen() const", referenced from:
      _main in main.o
  "sf::IpAddress::toString() const", referenced from:
      Connection::setUdpAddress(sf::IpAddress) in Connection.o
  "sf::IpAddress::toInteger() const", referenced from:
      Networking::processTCPDisconnection(sf::TcpSocket*) in Networking.o
      Networking::processUDPMessage(ZipPacket*, sf::IpAddress, unsigned short) in Networking.o
  "sf::TcpSocket::getRemoteAddress() const", referenced from:
      Networking::processTCPDisconnection(sf::TcpSocket*) in Networking.o
  "typeinfo for sf::Packet", referenced from:
      typeinfo for ZipPacket in PacketID.o
      typeinfo for ZipPacket in TCPServer.o
      typeinfo for ZipPacket in UDPServer.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
- and, of course, any other information that you think is relevant here:
When I try to compile it for 32bit instead of 64 bit, it gives all the same errors and an extra warning:
Quote
ld: warning: ignoring file /Library/Frameworks/SFML.framework/SFML, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /Library/Frameworks/SFML.framework/SFML

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Having a hard time getting SFML to work with Clang
« Reply #11 on: January 14, 2013, 01:16:40 pm »
Quote
I'd tried this method with making frameworks, dylibs and .a files. And I have it set to install the xcode template
On OS X, and more generally on Unixes, using static linking for libraries is not recommended. Then, you only need one binary. I recommend frameworks, but dylibs do the same job.

Quote
For framework, I added the SFML.framework to the project, set it in the Link Libraries, and added "/Library/Frameworks" to the Framework Search Path
So you're not using the SFML template, right ?

The issue is the following : SFML.framework only contains header and should not be used for any other purpose than that. What you need to do is to add sfml-$module.framework to your project for every $module that you need.
SFML / OS X developer

 

anything