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

Author Topic: (Tutorial Problem) - First page not working.  (Read 3386 times)

0 Members and 1 Guest are viewing this topic.

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
(Tutorial Problem) - First page not working.
« on: October 19, 2014, 04:32:35 pm »
Hello all, I am having some problems with the first turotial (http://sfml-dev.org/tutorials/2.1/start-vc.php) page and im not sure whats up, it gives a compile/build error and im not too good with these yet, can anyone tell me what this means?

Quote
1>c:\cpp\_sfml\_my code\start\firstprg\firstprg\firstprg.cpp(1): warning C4627: '#include <SFML/Graphics.hpp>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\cpp\_sfml\_my code\start\firstprg\firstprg\firstprg.cpp(25): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?

Nothing previously went wrong, I have VS/c++ 2010 express installed and downloaded the right code version (im a 64bit machine as well, if that helps). I've got to the last past where you past the code in and run it, but visual studio appears to be annoyed that an automatically generated file (that came with the project) has not been referenced in the main program (which is FirstPrg.cpp).

Can anyone help make any sense of this?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
AW: (Tutorial Problem) - First page not working.
« Reply #1 on: October 19, 2014, 04:40:35 pm »
My suggestion is to use the Empty Project option and start again fresh. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: (Tutorial Problem) - First page not working.
« Reply #2 on: October 19, 2014, 04:42:40 pm »
Ok thanks i'll give that a try. Not sure if you are a regular enough person, but any change of getting the tutorial page updated? I was quite frustrated at the start where it said there was three different projects I could go with, but didn't tell me which one the tutorial needed me to take to make it work!

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: (Tutorial Problem) - First page not working.
« Reply #3 on: October 19, 2014, 04:45:45 pm »
Actually I cant do this with an empty project, in the project properties page, the tutorial wants me to set up settings in the linker page, but quite simply there is no such page on an empty project.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: (Tutorial Problem) - First page not working.
« Reply #4 on: October 19, 2014, 04:50:29 pm »
Not sure if you are a regular enough person, but any change of getting the tutorial page updated? I was quite frustrated at the start where it said there was three different projects I could go with, but didn't tell me which one the tutorial needed me to take to make it work!
With three projects, you mean Console Application, Windows Application and Empty project, right?

We could indeed clarify that. In my opinion, Empty project should be the default and the one we recommend, having pre-written (and often VS-specific) code is not the best idea for newcomers. The Windows Application could be mentioned so that people know how to remove the console, maybe also the subsystem property in the project settings should be mentioned. I don't see a reason to tell about Console Application.

Actually I cant do this with an empty project, in the project properties page, the tutorial wants me to set up settings in the linker page, but quite simply there is no such page on an empty project.
The option should be there as long as you don't build a static library. In that case there's a Librarian page instead.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: (Tutorial Problem) - First page not working.
« Reply #5 on: October 19, 2014, 04:57:11 pm »
Ahh ok, I've figured it out, turns out you get different project properties if you click on the main.cpp file (in solution explorer) to the actual top project level. However, sorry to test people's patience, but the error I now get when running the sample code is:

Quote
1>sfml-graphics.lib(sfml-graphics-2.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

I've got a 64bit processor, with a 64bit windows, and downloaded the 64bit librarys from this site, so im not quite sure why VC++ is saying that I have a 32bit machine?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: (Tutorial Problem) - First page not working.
« Reply #6 on: October 19, 2014, 05:04:58 pm »
Because you didn't change the compiler to x64...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: (Tutorial Problem) - First page not working.
« Reply #7 on: October 19, 2014, 05:10:05 pm »
Do you mean going into project properties > config properties > linker > advanced

and changing target machine to "Machine64"?

Because i've already done that and it doesnt solve the issue.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: (Tutorial Problem) - First page not working.
« Reply #8 on: October 19, 2014, 05:16:46 pm »
You are aware that in order to program you actually need to understand what your tools do, right?
We here maintain and provide help for a library, learning how to work with the IDE you choose must come from your own side. ;)

No, you have to change the compiler not the project target. Might want to google if you can't find it.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

CrazyCrinkle

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: (Tutorial Problem) - First page not working.
« Reply #9 on: October 19, 2014, 05:28:42 pm »
Thanks for that, although to be honest, I've had more partial success by just changing everything to 32bit as my VC++ 2010 isnt configured for 64bit use (because theres no 64bit projects in the new project menu). And this time it compiles and gets further (a black box even appears in the background). However it errors, saying: "sfml-graphics-2.dll is missing from your computer"

Now i've found the DLL is in "\SFML-2.1\bin" but does anyone know where i would put it to make the program work?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: (Tutorial Problem) - First page not working.
« Reply #10 on: October 19, 2014, 05:40:05 pm »
By carefully reading the tutorial:

Quote
Now compile the project, and if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything