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

Author Topic: Help installing THOR and SFGUI.  (Read 9795 times)

0 Members and 1 Guest are viewing this topic.

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Help installing THOR and SFGUI.
« on: July 29, 2014, 09:20:44 am »
Hi there,
I'm having trouble getting the thor and sfgui libraries to work. I'm using latest versions of SFML and both libraries. Xcode recognises that these libraries exist (autocomplete works), but whenever I try and compile a project I get the message:

>> Undefined symbols for architecture i386:

I think I must have done something wrong during installation. I ran cmake on both libraries with settings copied from their respective tutorials. I then dragged the .o and src files to usr/local/lib and the headers to usr/local/include.

Can anyone guide me through the installation, or link me information to help demystify the process?
Please be patient if I forgot to mention something.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Help installing THOR and SFGUI.
« Reply #1 on: July 29, 2014, 09:44:10 am »
Concerning Thor, have you read the tutorial? You should probably install the libraries, not just copy the files.

But I don't have an OSX system to test Thor, so it may be that some things don't work immediately. As far as I know, there are a few other people using Thor on OSX, so you might want to search a bit...

Concerning SFGUI, things look probably similar, but there are other people who are definitely more familiar with it ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #2 on: July 29, 2014, 11:01:46 am »
Thank you for your response.

>> Concerning Thor, have you read the tutorial?
>> You should probably install the libraries, not just copy the files.

I followed the tutorial but it didn't work: xcode could not recognise the #includes until I dragged the files in manually. I don't really know where to begin because the entire process feels like black magic to me: calling out incantations found on internet tutorials and hoping. Is there a straightforward way of installing c++ libraries that 'just works'?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Help installing THOR and SFGUI.
« Reply #3 on: July 29, 2014, 08:01:22 pm »
... I don't really know where to begin because the entire process feels like black magic to me: calling out incantations found on internet tutorials and hoping. Is there a straightforward way of installing c++ libraries that 'just works'?
It is by no means "black magic". It is actually quite simple. Let me try to explain:

First you get the source code; either by simply cloning the git repository or by extracting some archive file (zip file, tar+gz file or whatever).
Then you use cmake (with appropriate options) to generate build files (nmake files, make files, Visual Studio Project files or whatever) that suit your environment/compiler.
Then you use your native build tools to build the library according to the files cmake just generated for you.
Once the library is compiled, you install it - again using your native toolchain in combination with the build files that cmake already generated.
Then you use the library.

On a Linux system, the above is usually as simple as:
git clone (or "git pull" if you already have a clone)
cmake
make
sudo make install

Takes all of 5minutes - how much easier do you want it?
The official tutorials even explain it in great detail (much more than I do here).
« Last Edit: July 29, 2014, 08:20:49 pm by Jesper Juhl »

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help installing THOR and SFGUI.
« Reply #4 on: July 29, 2014, 10:16:07 pm »
Quote
I then dragged the .o and src files to usr/local/lib
I can only strongly suggest you read very carefully the different official tutorial. It's completely wrong, sorry.

If you have a specific question about the tutorial, please ask.
SFML / OS X developer

Strelok

  • Full Member
  • ***
  • Posts: 139
    • View Profile
    • GitHub
Re: Help installing THOR and SFGUI.
« Reply #5 on: July 29, 2014, 10:28:58 pm »
It's always amusing when people using apple software expect to be hand held through every single thing, even with a tutorial :) Dark magic ;D

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #6 on: July 30, 2014, 11:32:43 am »
Quote
It is by no means "black magic". It is actually quite simple. Let me try to explain:

First you get the source code; either by simply cloning the git repository or by extracting some archive file (zip file, tar+gz file or whatever).
Then you use cmake (with appropriate options) to generate build files (nmake files, make files, Visual Studio Project files or whatever) that suit your environment/compiler.
Then you use your native build tools to build the library according to the files cmake just generated for you.
Once the library is compiled, you install it - again using your native toolchain in combination with the build files that cmake already generated.
Then you use the library.

On a Linux system, the above is usually as simple as:
git clone (or "git pull" if you already have a clone)
cmake
make
sudo make install

Takes all of 5minutes - how much easier do you want it?
The official tutorials even explain it in great detail (much more than I do here).

Do you speak mandarin? It really is quite simple. Why, even millions of little children can do it.
Seriously though, I did as you say yet still get the following error:
>> Undefined symbols for architecture i386:

I will repeat the steps I took:
1) downloaded the source from github
2) used cmake to build files
3) went into repository and 'sudo make install'

Where did I err? For those who linked to the SFML tutorial: I already have SFML installed, I am trying to install other libraries. Thanks for helping.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help installing THOR and SFGUI.
« Reply #7 on: July 30, 2014, 12:03:41 pm »
Quote
>> Undefined symbols for architecture i386:
It would certainly help to see the list of undefined symbols (should be right below in your compiler output).

Quote
I ran cmake on both libraries with settings copied from their respective tutorials. I then dragged the .o and src files to usr/local/lib and the headers to usr/local/include.
I'm pretty sure that the OS X tutorial for SFML explains a totally different way of installing it. Because this one is wrong ;)
Laurent Gomila - SFML developer

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #8 on: July 30, 2014, 01:07:08 pm »
Quote
It would certainly help to see the list of undefined symbols (should be right below in your compiler output).

Is this what you were referring to?

Undefined symbols for architecture i386:
  "thor::Timer::start()", referenced from:
      _main in main.o
  "thor::Timer::Timer()", referenced from:
      _main in main.o
  "thor::Timer::~Timer()", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Quote
I'm pretty sure that the OS X tutorial for SFML explains a totally different way of installing it. Because this one is wrong ;)
Again, I am not installing SFML (see previous post).

Does anyone have any suggestions?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Help installing THOR and SFGUI.
« Reply #9 on: July 30, 2014, 01:22:31 pm »
Again, I am not installing SFML (see previous post).
This is equally wrong for any library. You cannot link to source or object files*.

How are you linking Thor? Are you really sure that you follow every step in the tutorial?


_______
* Of course object files generated from the source are combined in the linker step. But that's not the way to use external libraries.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help installing THOR and SFGUI.
« Reply #10 on: July 30, 2014, 01:39:25 pm »
Quote
Again, I am not installing SFML (see previous post).
Ah, sorry. I confused SFML and SGFUI.
Laurent Gomila - SFML developer

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #11 on: July 30, 2014, 02:04:29 pm »
Again, thanks to everybody for trying to help me out.
Quote
This is equally wrong for any library. You cannot link to source or object files*.
Heh?

Quote
How are you linking Thor? Are you really sure that you follow every step in the tutorial?
From my previous post:
1) downloaded the source from github
2) used cmake to build files
3) went into repository and typed 'sudo make install' into terminal

It's very frustrating when posters (above) say:
Quote
It is actually quite simple.. use your native build tools to build the library according to the files cmake just generated for you.
Once the library is compiled, you install it - again using your native toolchain in combination with the build files that cmake already generate
You kind of skipped a few steps there mate. "Again using your native toolchain".. what?

You explanation assumes way too much. As I have posted repeatedly, I don't understand how this whole process works. Can someone walk me through this step-by-step? And yes, I have read the tutorial. I know how to search google. I would not be asking if I hadn't put considerable effort into making this work myself first.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help installing THOR and SFGUI.
« Reply #12 on: July 30, 2014, 02:42:07 pm »
Quote
From my previous post:
1) downloaded the source from github
2) used cmake to build files
3) went into repository and typed 'sudo make install' into terminal
That's how you compiled and installed it. We're asking you how you link it to your own project.

Quote
You explanation assumes way too much. As I have posted repeatedly, I don't understand how this whole process works.
Some good reading about compilation / linking steps (from a general point of view, then specifically for your development tools) may be worth it ;)
Laurent Gomila - SFML developer

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Help installing THOR and SFGUI.
« Reply #13 on: July 30, 2014, 05:16:30 pm »
I'll try to find the time to write a better explanation later tonight.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Help installing THOR and SFGUI.
« Reply #14 on: July 30, 2014, 07:37:42 pm »
I asked because it looks like you just forgot a -l flag or chose the wrong one. Thus again, how are you linking Thor? This is explained on the website, but since you don't mention the link step and instead talk about dragging .o files around, we have to assume you did not link the library correctly. And yes, reading about the C++ compilation and linking model in general would definitely be a good idea :)

Jesper Juhl, I don't know whether that's worth the effort, since the tutorial says already everything... and if it doesn't, you should rather point out where it could be improved, so that we can help also in other cases ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: