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

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

0 Members and 2 Guests are viewing this topic.

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #15 on: July 31, 2014, 07:35:38 am »
Ok I read some stuff about the compilation process but still can't get things to work and could not find any good sources on library installation. The tutorial skips a lot of steps and does not mention linking.

Quote
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).
Done.

Quote
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.
Done. (see attached screenshot)

Quote
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.

Ok - here's what I did. First I tried the following commands (from above post):
make
sudo make install

Nothing happened. Next I tried the following: opened the newly created xcode project file and tried to build.
This step fails with the following error:
"Invalid operands to binary expression sf::Time and sf::Time.
float getElapsedRatio(const Particle& particle)
{
        return getElapsedLifetime(particle) / getTotalLifetime(particle);
}

float getRemainingRatio(const Particle& particle)
{
        return getRemainingLifetime(particle) / getTotalLifetime(particle);
}
 

I also tried including it in another project with the following:

#include <Thor/..>

Quote
I asked because it looks like you just forgot a -l flag or chose the wrong one. Thus again, how are you linking Thor?
-l flag? Re - Linking thor. I explained above. If not, could you be more specific? Terse explanations filled with jargon are not helpful...
------------------------------------------------------------------------------------------------------------------------

If I have omitted anything let me know.
« Last Edit: July 31, 2014, 07:39:16 am by bottles »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help installing THOR and SFGUI.
« Reply #16 on: July 31, 2014, 07:54:44 am »
Quote
Ok - here's what I did. First I tried the following commands (from above post):
make
sudo make install

Nothing happened.
These commands are for makefiles. But since you chose the XCode generator and not the Makefiles one (in CMake), this doesn't apply. Some people like to give the Linux example because it's dead simple, but that was irrelevant here because you're not using Linux nor makefiles ;)

So for you, this translates to: "open the generated XCode project and compile it". To install the library: compile the project named "INSTALL"; CMake should have created one for you.

Quote
This step fails with the following error:
"Invalid operands to binary expression sf::Time and sf::Time.
It seems like you don't have the SFML version that matches the version of Thor that you picked. Here I can't help, but I assume that it is written somewhere in the doc or download page.

Quote
-l flag? Re - Linking thor. I explained above. If not, could you be more specific? Terse explanations filled with jargon are not helpful...
You always explain how you build & install Thor. That's fine, since you have problems with that too, but what we are asking is how you link it to your own project. What project settings did you change to say "my project should link to the Thor library"?
You never talked about your own project settings, would be good to start doing it now ;)
Laurent Gomila - SFML developer

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #17 on: July 31, 2014, 08:50:22 am »
Quote
So for you, this translates to: "open the generated XCode project and compile it".
Done. I had to checkout an older thor build to get it to compile.

Quote
To install the library: compile the project named "INSTALL"; CMake should have created one for you.
Is this a separate instruction from the previous? There was no project named "Install", only thor.xcodeproj.

Quote
What project settings did you change to say "my project should link to the Thor library"?
None, nobody mentioned project settings until now. Is this what you meant by linking? I stated several times that I didn't understand the process, please don't skip important steps.
How do I link the project to the thor library?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Help installing THOR and SFGUI.
« Reply #18 on: July 31, 2014, 09:45:36 am »
Quote
There was no project named "Install", only thor.xcodeproj
Inside thor.xcodeproj, there should be multiple targets: thor, INSTALL and ZERO_CHECK.

Quote
None, nobody mentioned project settings until now. Is this what you meant by linking? I stated several times that I didn't understand the process, please don't skip important steps.
How do I link the project to the thor library?
So you created an empty project, wrote some code involving thrd-party libraries and thought it would work automagically, without configuring anything? :P

When you use a library, there are generally 3 steps to follow:
- add its header path to the compiler include search paths (if not in a standard path), so that it can resolve your #include statements
- add its libs path to the linker search paths (if not in a standard path), so that it can find the library
- add the library name to the linker input

Some libraries also require to define some macros, depending on which variant you use (for example, SFML requires to define SFML_STATIC if you link the static libraries).

This process is VERY important to understand, you'll have to repeat it everytime you'll use a library.

All this stuff is explained in detail in the SFML tutorials, and I'm pretty sure Thor and SFGUI also have similar explanations. Have you read them?
Laurent Gomila - SFML developer

greenk

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #19 on: July 31, 2014, 10:59:41 am »
Again, not working.

Quote
Inside thor.xcodeproj, there should be multiple targets: thor, INSTALL and ZERO_CHECK.
There is THOR, ZERO_CHECK and ALL_BUILD, but no install. I assume ALL_BUILD is what you meant?
As stated previously I compiled this. Is that all that needs to be done for this step? Where did it install the library on my computer?

Quote
So you created an empty project, wrote some code involving thrd-party libraries and thought it would work automagically, without configuring anything? :P
Yeah haha I'm such an idiot right? I told you I didn't understand the process, you failed to mention critical instructions and yet i am supposed to automagically have read your mind? :P

Quote
When you use a library, there are generally 3 steps to follow:
- add its header path to the compiler include search paths (if not in a standard path), so that it can resolve your #include statements
Have I done that already in previous instructions? If not, how do I do it?
Quote
add its libs path to the linker search paths (if not in a standard path), so that it can find the library
Have I done that already in previous instructions? If not, how do I do it?
Quote
add the library name to the linker input
Have I done that already in previous instructions? If not, how do I do it?

Please stop skipping instructions! You tell me: 'do x, then do y' without saying how to do them.

Quote
This process is VERY important to understand, you'll have to repeat it everytime you'll use a library.
All this stuff is explained in detail in the SFML tutorials... rtfm
None of this stuff is explained in the tutorial, which *as I stated earlier* I had read.

I appreciate the help.
« Last Edit: July 31, 2014, 11:04:29 am by bottles »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Help installing THOR and SFGUI.
« Reply #20 on: July 31, 2014, 11:11:16 am »
Please stop skipping instructions! You tell me: 'do x, then do y' without saying how to do them.
The tutorial contains the most detailed explanation possible, what's the point of repeating every step in this thread?


None of this stuff is explained in the tutorial, which *as I stated earlier* I had read.
Sorry, but this is simply wrong.

The Thor tutorial clearly mentions the link step, you can't miss it if you read it carefully.
Quote
3. Link and compile Thor

As soon as your libraries are built, you can use Thor in your projects. The generated libraries have the following naming scheme:

Dynamic Linkage, Release thor
Dynamic Linkage, Debug thor-d
Static Linkage, Release thor-s
Static Linkage, Debug thor-s-d

If necessary, add the library prefixes ("lib") and file extensions (".lib", ".dll", ".so") corresponding to your platform and compiler.

When you link statically, you have to add SFML_STATIC to your project's preprocessor definitions.

If you compile with g++, you need to add the compiler flag -std=c++0x. On Linux, you should not forget to call ldconfig (possibly using sudo) in order to update the paths so that the binaries are found.

If you use these library names nowhere or do not understand what the section means, please don't just assume you don't have to do it and say that things don't work "although you have followed the tutorial".

It is not the task of libraries like SFML and Thor to explain how linking in C++ works. Assuming you know the general process (which you have to learn elsewhere), there is definitely enough information to know how to use the library. The SFML tutorial is even more verbose, with screenshots and everything -- probably even enough to teach you everything if it's the first library you are using.
« Last Edit: July 31, 2014, 11:17:12 am by Nexus »
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 #21 on: July 31, 2014, 11:14:31 am »
Quote
There is THOR, ZERO_CHECK and ALL_BUILD, but no install. I assume ALL_BUILD is what you meant?
No. If there's no INSTALL target, then it means that the library doesn't define it. So I guess you have to copy the produced libraries and headers manually (Nexus can tell you more about that).

Quote
Please stop skipping instructions! You tell me: 'do x, then do y' without saying how to do them.
Maybe someone else can explain you how to do this with XCode (I don't use it), but in the meantime you can ask Google things like "XCode add include path", etc. This is the very very very first basic step to understand before trying to use libraries; even before trying to develop anything. So it will probably be worth it; someone nice may teach you how to use your IDE on this forum, but I strongly suggest you don't wait for it and search by yourself instead. You'll learn and remember things more easily if you do so.
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Help installing THOR and SFGUI.
« Reply #22 on: July 31, 2014, 11:20:16 am »
If there's no INSTALL target, then it means that the library doesn't define it. So I guess you have to copy the produced libraries and headers manually (Nexus can tell you more about that).
There should be an INSTALL target, that's actually the way I intend the library to be installed. Maybe there is a problem with the XCode configuration though; unfortunately I get very few feedback for OS X and can't test on my own.
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 #23 on: July 31, 2014, 12:12:28 pm »
When you are a beginner you lack the language to articulate your problems. I wouldn't have had a clue which terms to google. At least in my opinion, the tutorials were not comprehensive, nor did they explains things properly.
All this may be obvious to experienced developers like yourselves, so I don't expect for you to relate. Or maybe I am just an idiot. I still haven't been able to get anything to work. I really am thankful for your attempts :(

MadMartin

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: Help installing THOR and SFGUI.
« Reply #24 on: July 31, 2014, 12:22:38 pm »
The main problem is IMHO that beginners don't familiarize themselves properly with the tools they use. The forum is full of threads about linking problems and stuff like that.

With an exotic tool chain it's even more important to know your tools and the associated workflow.
(OSX is indeed an exotic tool chain, compared to the main competitors).

I don't want to sound disrespectful or condescending, but I think you need to take a closer look at your tools before using some third-party libraries!
I had the same (or similar) problems at the beginning of my programming career, but at those times, there where no forums or even google to solve my problems. Just me and the compiler's manual  ;)

Don't give up, but also don't be snappish if you don't succeed directly.

Good luck!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Help installing THOR and SFGUI.
« Reply #25 on: July 31, 2014, 05:36:11 pm »
Xcode is known to be a bad generator for cmake. It's explained at least in the SFML tutorial and probably in other places around the web.. Use makefile instead.

Also, you have to be more open-minded: you definitely won't always find a precise step-by-step procedure to solve your problems. You need to learn to look around for clues on your own, beginning by knowing your tools. And yes, the start is always hard but there's no magical solution.
SFML / OS X developer

 

anything