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

Author Topic: Weird thing with Visual Studio  (Read 4449 times)

0 Members and 1 Guest are viewing this topic.

Gio

  • Newbie
  • *
  • Posts: 16
    • View Profile
Weird thing with Visual Studio
« on: June 14, 2010, 10:46:49 pm »
I got this error when I was compiling SFML with Visual Studio, as both Debug and release, with the proper linking done and SFML_DYNAMIC added. I am using the Graphics and System Packages, but neither use nor link to the Window Package. here it is:
Code: [Select]
1>------ Build started: Project: Simple Rogue, Configuration: Release Win32 ------
1>  Floor.cpp
1>  Levels.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\SFML/Window/Window.hpp(321): error C2248: 'sf::NonCopyable::NonCopyable' : cannot access private member declared in class 'sf::NonCopyable'
1>          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\SFML/System/NonCopyable.hpp(57) : see declaration of 'sf::NonCopyable::NonCopyable'
1>          C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\SFML/System/NonCopyable.hpp(41) : see declaration of 'sf::NonCopyable'
1>          This diagnostic occurred in the compiler generated function 'sf::Window::Window(const sf::Window &)'
1>  Monster.cpp
1>  Player.cpp
1>  Simple Rogue.cpp
1>  Wall.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks in advance.
~~Gio~~

Zweistein

  • Newbie
  • *
  • Posts: 29
    • View Profile
Weird thing with Visual Studio
« Reply #1 on: June 14, 2010, 10:53:27 pm »
I think it comes, when you try to copy a class, that is defined as not copyable.

Do you pass a Copy of a sf::Window Instance or from a sf::Window derived class as argument somewhere in Levels.cpp?

try using Pointers.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Weird thing with Visual Studio
« Reply #2 on: June 14, 2010, 11:57:10 pm »
Quote
try using Pointers.

References are better ;)
Laurent Gomila - SFML developer

Zweistein

  • Newbie
  • *
  • Posts: 29
    • View Profile
Weird thing with Visual Studio
« Reply #3 on: June 15, 2010, 12:13:38 am »
come on, it was not bad for my first helping post :)

Gio

  • Newbie
  • *
  • Posts: 16
    • View Profile
Weird thing with Visual Studio
« Reply #4 on: June 15, 2010, 03:16:38 am »
W00-H00! I got it to compile in both configurations! But it won't run. Debug says:
Quote
This Application has failed to start because the Application configuration is incorrect. Review the manifest file for possible errors. Reinstalling the Application may fix the problem (yea right :roll:).For more details, please see the application event log
That's with Debug on. Off, the thing just crashes.
Here's release:
Quote
Unhandled exception at 0x766c1ca4 in Simple Rogue.exe: 0xC0000005: Access violation reading location 0x00000002.
Break              Continue               Ignore

I am forced to break, and here's the odd line of code in some .c file causing problems:
Code: [Select]
 if (__native_startup_state == __initializing)
            {
                _initterm( __xc_a, __xc_z );//this one
                __native_startup_state = __initialized;
            }

I know this is sort of off-topic, but I need it to run my game! If anyone knows anything about this stuff, i would greatly appreciate it... (and probably stop complaining about Visual Studio on this Forum) :(
~~Gio~~

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Weird thing with Visual Studio
« Reply #5 on: June 15, 2010, 08:06:21 am »
In debug, make sure that you link to the SFML debug libraries (-d suffix). Also make sure that you use the libraries corresponding to your version of Visual C++ (if you use VC++ 2010 you must recompile SFML).

If everything is ok then show your code :)
Laurent Gomila - SFML developer

Gio

  • Newbie
  • *
  • Posts: 16
    • View Profile
Weird thing with Visual Studio
« Reply #6 on: June 16, 2010, 03:12:30 am »
I did link to the Debug versions for the Debug but did not (re)build the library for VC++2010. I used the Build folder to convert it, but am not sure what to replace or even if I really updated it. I also took note of the fact that every time I run the Debug Config the project rebuilds itself even if I just built it in the same config.
~~Gio~~

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Weird thing with Visual Studio
« Reply #7 on: June 16, 2010, 08:24:42 am »
Quote
I used the Build folder to convert it, but am not sure what to replace or even if I really updated it

You just have to open the VC 2008 solution, click "ok" (for the conversion wizard), select the configuration that you want to build (Debug/Release static/DLL) and click "rebuild all".
Laurent Gomila - SFML developer

kitchen

  • Newbie
  • *
  • Posts: 14
    • View Profile
Weird thing with Visual Studio
« Reply #8 on: June 16, 2010, 09:18:09 am »
Quote from: "Gio"
I did link to the Debug versions for the Debug but did not (re)build the library for VC++2010. I used the Build folder to convert it, but am not sure what to replace or even if I really updated it. I also took note of the fact that every time I run the Debug Config the project rebuilds itself even if I just built it in the same config.


I made a showing how to do this. It works the same for non-express editions as well.

Gio

  • Newbie
  • *
  • Posts: 16
    • View Profile
Weird thing with Visual Studio
« Reply #9 on: June 22, 2010, 06:13:37 pm »
I followed the video, refreshed the linker and moved the new .dll's in but could not fix the problem. I also rebuilt the game.
~~Gio~~