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

Author Topic: Error installing/compiling with VS2015 community  (Read 4949 times)

0 Members and 1 Guest are viewing this topic.

jp

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Error installing/compiling with VS2015 community
« on: January 17, 2016, 02:55:47 pm »
****** UPDATE: please note this problem seems to be due to VC++ problem which seems to be "broken" somehow on my machine currently, so this post can be ignored until I fix it ***********

SOLVED (VS SETTINGS ISSUE): IF YOU WANT TO KNOW THE REASON, ITS IN THE LAST POST.

********************************************************************************


Hello,
I followed the instructions from the SFML documentation to install SFML to my Visual Studio 2015 community but I keep getting these errors:

1>------ Build started: Project: SfmlConcoleTemp, Configuration: Debug x64 ------
1>  main.cpp
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\config.hpp(163): error C2061: syntax error: identifier 'sf'
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\config.hpp(163): error C2059: syntax error: ';'
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\config.hpp(164): error C2449: found '{' at file scope (missing function header?)
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\config.hpp(190): error C2059: syntax error: '}'
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\system\clock.hpp(35): error C2061: syntax error: identifier 'sf'
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\system\clock.hpp(35): error C2059: syntax error: ';'
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\system\clock.hpp(36): error C2449: found '{' at file scope (missing function header?)
1>e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\system\clock.hpp(84): error C2059: syntax error: '}'
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\vcruntime.h(294): error C2146: syntax error: missing ')' before identifier '_StackCookie'
...

I put my SMFL folder to: H:\SFML   and then I also tried to put it on the same project where the project is but it does not help.

The project recognizes #include <SFML\Graphics.hpp> ... it does not give any red marks when I put it in main.cpp so the project can see  SFML\Graphics.hpp.

I have done it in couple of ways (I also followed the youtube instructions at watch?v=2JVpmWwMo0o ) but I get the same error. Is there some setting in VS2015 default project which are not compatible with SFML? I tried Windows version and console version but I get the same errors.

I downloaded SFML-2.3.2-windows-vc14-64-bit and have Windows 10 compiled with 64bit projects.

Does the binary SFML-2.3.2-windows-vc14-64-bit work out of the box or I have to compile it somehow?

Thank you.
« Last Edit: January 18, 2016, 02:00:52 am by jp »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #1 on: January 17, 2016, 06:50:18 pm »
GCC is a compiler on its own, if you use Visual Studio use the Visual Studio package.

If you're even getting compiler errors in VS headers, your VS install is broken or you did something very odd.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jp

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #2 on: January 17, 2016, 08:56:54 pm »
Sorry I pasted the wrong file name... I did not use GCC version but VS version. I really used: SFML-2.3.2-windows-vc14-64-bit. I just compiled again using this one and it gives the same error messages.

But the first error messages are coming from SFML, so why are they coming?

The VC errors can be because of the SFML error messages, isnt it?

The first error message is: "error C2061: syntax error: identifier 'sf'", so it cannot find the sf namespace for same reason. I guess it has nothing to do with VS header files.
« Last Edit: January 17, 2016, 09:02:15 pm by jp »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Error installing/compiling with VS2015 community
« Reply #3 on: January 17, 2016, 09:02:48 pm »
What does your e:\important\programming\c++\temp\sfmlconcoletemp\sfmlconcoletemp\include\sfml\config.hpp contain?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jp

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #4 on: January 17, 2016, 09:25:25 pm »
hmm, I found something strange... my 64 bit project does not understand "namespace" keyword :) (32 bit understands). So this might be the issue. I will try to solve this and come back after that if there is any SFML related issues. This is why it was complaining about "namespace sf".

Yes, its possible my VS got somehow broken today. It worked ok yesterday so it surpriced me...



« Last Edit: January 17, 2016, 09:36:05 pm by jp »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Error installing/compiling with VS2015 community
« Reply #5 on: January 17, 2016, 11:28:51 pm »
I can't imagine that the compiler doesn't understand namespace. There's probably something messed up in header files, like an unmatched parenthesis. Maybe combined with conditional compilation, so it manifests only in x64 mode.

In case of doubt, reinstall VS.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

jp

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #6 on: January 18, 2016, 12:06:32 am »
Don't know, but this never happened before. Am sure all (including namespaces) were compiling ok yesterday. But yes, just uninstalling and re-installing VS now.

But the odd thing is that if I start a totally new x64 project it does not understand "namespace". But lets see what happens after I re-installed.

jp

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #7 on: January 18, 2016, 01:59:43 am »
uh, I found the problem!! :). Just for the record, it was this: In properties Advanced/Compile As , I has "compile as C" , :). I was testing something in the morning and I guess was copied to all projects somehow (still dont know why all other projects had it also? even though I started new projects). So that should be "compile as C++". Its strange that even after re-installing it was still there , C compilation. Maybe it stayed in the registry.


If a moderator can delete this post, maybe best to delete as it was not a SFML issue. or move it.
« Last Edit: January 18, 2016, 02:01:59 am by jp »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Error installing/compiling with VS2015 community
« Reply #8 on: January 18, 2016, 02:03:35 am »
Settings usually are kept unless you explicitly removed them.

We don't delete threads, maybe someone will run into a similar issue one day...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/