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

Author Topic: Problems Setting Up SFML2.1  (Read 3376 times)

0 Members and 1 Guest are viewing this topic.

YukiTrance

  • Newbie
  • *
  • Posts: 5
    • View Profile
Problems Setting Up SFML2.1
« on: September 25, 2013, 03:30:02 am »
I'm sort-of new to SFML and I seem to be having a huge problem. I'm using MSVS 2010. My configuration is as follows.

The problem is that MSVS isn't detecting headers and I can't find the issue.






eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems Setting Up SFML2.1
« Reply #1 on: September 25, 2013, 03:37:37 am »
The problem is that MSVS isn't detecting headers and I can't find the issue.
How are you noticing this?
Do you get a compiler or linker error? If so, can you post it here? :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

YukiTrance

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems Setting Up SFML2.1
« Reply #2 on: September 25, 2013, 03:48:51 am »
How are you noticing this?
Do you get a compiler or linker error? If so, can you post it here? :)

Intellisense isn't suggesting the SFML/ folder. The #import is underlined red.

Build errors:

IntelliSense: cannot open source file "c:/Users/Kyle/documents/visual studio 2010/Projects/Kit/Kit/Debug/Window.tlh"   

IntelliSense: cannot open source file "c:/Users/Kyle/documents/visual studio 2010/Projects/Kit/Kit/Debug/Graphics.tlh"   

Only code I have right now is just a basic "int main()" with a return. I'm importing the Window and Graphics module as well.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Problems Setting Up SFML2.1
« Reply #3 on: September 25, 2013, 04:14:39 am »
Intellisense is the autocompletion tool.  It has nothing to do with the compiler or the linker, so errors with it should have no effect whatsoever on your ability to compile and run your code.  Have you actually tried building and running or did you stop as soon as you saw these errors?

YukiTrance

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems Setting Up SFML2.1
« Reply #4 on: September 25, 2013, 04:21:29 am »
Intellisense is the autocompletion tool.  It has nothing to do with the compiler or the linker, so errors with it should have no effect whatsoever on your ability to compile and run your code.  Have you actually tried building and running or did you stop as soon as you saw these errors?

Forgot to mention that I already tried building. Breaks on "#import <SFML/Window.hpp>", which is the first line.

error C1083: Cannot open type library file: 'c:\sfml-2.1\include\sfml\window.hpp': Error loading type library/DLL.   

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Problems Setting Up SFML2.1
« Reply #5 on: September 25, 2013, 05:03:14 am »
I've never heard of #import.  Have you tried a standard #include instead?

YukiTrance

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems Setting Up SFML2.1
« Reply #6 on: September 25, 2013, 05:08:02 am »
EDIT: Yes, sorry, I meant #include. Got mixed up with another language.

I've found the problem. I created an empty project instead of a Win32 project.

Not sure why it would actually matter, but that was the problem.

Another problem, which I got before but thought it had to do with the headers, is that after about 3-4 seconds, I get an access violation.

Which, as I've experienced before, stops the program from actually going through with its code.

"Unhandled exception at 0x76f7fc1b in kit.exe: 0xC0000005: Access violation writing location 0x00790ffc."

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Problems Setting Up SFML2.1
« Reply #7 on: September 25, 2013, 05:31:19 am »
Run a debug build so the debugger can tell you exactly where why and how the access violation happened.

Edit:
Quote
I've found the problem. I created an empty project instead of a Win32 project.  Not sure why it would actually matter, but that was the problem.
This sounds strange enough I decided to quickly try it myself.  An "empty" project with standard hello world code seems to build and run just fine for me (Visual C++ 2010 Express).  No idea what happened to you.  Oh well.
« Last Edit: September 25, 2013, 05:38:48 am by Ixrec »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problems Setting Up SFML2.1
« Reply #8 on: September 25, 2013, 07:00:16 am »
It's anyways better to start your project off an empty project, rather than a Win32 project, because the Win32 project already adds a few things you don't really need. Why it wouldn't work with Win32, I don't know.

As for access violation, we can't really help further. You'll need to provide the code and at best run it as Ixrec suggested through the debugger to find out where it crashes.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

YukiTrance

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Problems Setting Up SFML2.1
« Reply #9 on: September 25, 2013, 08:18:23 pm »
It's anyways better to start your project off an empty project, rather than a Win32 project, because the Win32 project already adds a few things you don't really need. Why it wouldn't work with Win32, I don't know.

As for access violation, we can't really help further. You'll need to provide the code and at best run it as Ixrec suggested through the debugger to find out where it crashes.

I'm still not really sure what the problem was with it, but it seems to work now for some reason.