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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ingwik

Pages: 1 2 3 [4] 5
46
Python / What version of Python for Windows 7 64 bit?
« on: November 17, 2011, 03:25:13 pm »
So, in short:
*I should use Python 2.7.2.
*I should use SFML 2.0 - but I have to compile it myself with VC++ 2010 express since it is intended for 64 bit system.

Then I assume python 2.7.2 will work with SFML 2.0 compiled for a 64 bit system, or do I have to compile SFML for a 32 bit system?

47
Python / What version of Python for Windows 7 64 bit?
« on: November 17, 2011, 09:47:08 am »
So, I am a bit curious about other implementations than SFML for c++ when teaching youngsters programming and my eyes fell on PySFML. C++ is tough to learn if you've never done any kind of programming before (and python not too tough for me to learn I hope :). But then, before I try something stupid that might spoil a lot of time for me, I have some questions that I would love to get answered:

What is best, PySFML 1.6 or PySFML 2.0? When I startwed teaching SFML for C++ I choose 1.6 but that might have been a bad move and I really don't want to repeat it.

PySFML is not a compiled language (as far as I know) so it shouldn't matter if I use a 32 bit or a 64 bit environment, or am I wrong?

Most important; what kind of Python distribution do I need to use on the computer if I have Windows 7 enterprise 64 bit. Current versions are 2.7.2 or 3.2.2. Can I use the latest or do I need to use an older version?

48
Graphics / Animation show twice, why?
« on: November 13, 2011, 09:59:16 pm »
I solved it eventually, much thanks to this post:
http://www.sfml-dev.org/forum/viewtopic.php?t=5378&highlight=clock

In the "While app is opened" I need:
 
Code: [Select]
while (App.IsOpened())
     { //while 1 start
   const sf::Input &Input = App.GetInput();
   bool returnKeyDown = Input.IsKeyDown(sf::Key::Return);


And then, instead of:
Code: [Select]
if (App.GetInput().IsKeyDown(sf::Key::Return))
I use
Code: [Select]
 if (returnKeyDown == true)

This simple change make the routine run once instead of twice. Why? I can't say really. I suppose the first (faulty) routine reacts two times or maybe more since the key is pressed down, while the other (correct) routine just checks if the key is down and dont fire every cycle.


The function had one row of code too much.  Unfortunately it's the row of code that adjust the time. By comment out:
Code: [Select]
//if ((ExplosionClock.GetElapsedTime() > visningstid - 0.0) && (ExplosionClock.GetElapsedTime() < visningstid))
the explosion show all copy rects in a serie instead of the whole spritesheet at once, Anyway, it's solved and work now, even though it explodes so fast that I nearly can't see what happens. Any suggestion about how to change that?

49
Graphics / Animation show twice, why?
« on: November 13, 2011, 01:21:57 pm »
I'm using VC++ 2010 express, Win 7 64 enterprise and SFML 1.6

I'm trying to make a simple function to show an explosion. In the end, it's supposed to be part of an explosion class. Righht now, it should fire once when the enter key is pressed, but it doesn't.

I have two errors in the code that I don't understand:
1: The function fires twice. It shouldn't but I can't find any solutuion to the problem.
2: Copyrect fail, I see the whole bitmap-map and not copyrect squares creating an animation sequence.

The picture is:
http://cdn.pimpmyspace.org/media/pms/c/b9/9e/ez/xplosion17.png


Code:
Code: [Select]
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

#define SFML_STATIC //No extra DLL

using namespace std;    // to show the console


class Explosion
{
public :
    sf::Sprite Sprite; //The explosion sprite
};


void pang(float x, float y, Explosion &Klassinstans, sf::Image bildfilsnamn, sf::RenderWindow &App );
//Function to show explosion, forward declaration

int main (int argc, char *argv)
  { //main start

      //load pic
 sf::Image explosionsbildmap;
   //Size of spritemap  5 x 5 squares 64x64 pixels big
 if (!explosionsbildmap.LoadFromFile("xplosion17.png"))
     {
     cout << "Can't find: xplosion17.png " << endl;
     }

 //Create a copy of the class
 Explosion Explosionskopia;



      sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Test av explosion");
     // Creating render window
         while (App.IsOpened())
            { //while 1 start



sf::Event Event; //Check if event is used

              while (App.GetEvent(Event))
                { //while 2 start
                   if (Event.Type == sf::Event::Closed)
                       App.Close();//shut down program

if (App.GetInput().IsKeyDown(sf::Key::Return))
//Show the explosion
  pang(100, 100, Explosionskopia, explosionsbildmap, App);


   
          App.Clear(sf::Color(0, 100, 0)); //Green background
          App.Display(); //Show changes


} //while 1 ends
 } //while 2 ends

 } //main ends***************************************



//Function description
void pang(float x, float y, Explosion &Klassinstans, sf::Image bildfilsnamn, sf::RenderWindow &App )
{
int rutorY = 0; //max 5, pictures y
int rutorX = 0; //max 5, pictures x

int bildbredd = 64; //width of frame
int bildhojd = 64; //height of frame
sf::Clock ExplosionClock;
//Create a timer for the explosion
float visningstid = 0.1; // 0.1 sec between each frame


Klassinstans.Sprite.SetPosition(x,y);  
//Place the explosion on the game board

Klassinstans.Sprite.SetImage(bildfilsnamn);
ExplosionClock.Reset(); //make sure the clock i 0
while ( rutorY < 5)
{
while (rutorX < 5)
{

if ((ExplosionClock.GetElapsedTime() > visningstid - 0.0) && (ExplosionClock.GetElapsedTime() < visningstid))
            Klassinstans.Sprite.SetSubRect(sf::IntRect(bildbredd-64,bildhojd-64,bildbredd,bildhojd)); //Show first frame

//Check what happens in console
cout << "koordinater"<< bildbredd-64 << " , " << bildhojd-64 << " , " << bildbredd << " , " << bildhojd << " , " << endl;
cout << "tidskod " << visningstid << endl;

App.Draw(Klassinstans.Sprite);//Change picture
App.Display(); //Show changed picture

bildbredd = bildbredd + 64;
visningstid = visningstid + visningstid;
rutorX = rutorX + 1;
}

rutorX = 0;//Begin at first pic in next row

bildhojd = bildhojd + 64;
bildbredd = 64;
rutorY = rutorY + 1; //Switch to next row
//Show result in console
cout << "Y=" << rutorY << endl;
}



}//pang ends

50
General / How do I bring an SFML game out on the Internet?
« on: October 22, 2011, 02:52:49 pm »
Quote from: "Laurent"

For B/C, you can't use Python, .Net or Ruby.


That was bad news indeed. But... I can't stop thinking that there could/might be some kind of way to use SFML as a backend and showing the outcome, not in a renderwindow, but inside a <canvas></canvas> tag in a web browser instead. I just don't have enough skills in programming to make that happen.

se more about canvas:https://developer.mozilla.org/en/Canvas_tutorial

51
General / How do I bring an SFML game out on the Internet?
« on: October 22, 2011, 02:35:00 pm »
Well, to be honest I think both ideas are intiguing.
A: Hosting a multiplayergame... Like a WoW server do. I assume you make the "client games " in SFML but use a serverprogram to connect the differen clients. That should be possible already, I think, one way or the othe through the network module in SFML. At the end of the day, it's probably best to have the clients connect between each other and just making one of the clients a "server", like you used to do in the old days with Starcraft 1 or World of Warcraft 1. Limits the amount of players though.

B: Making a game you can play online without downloading too much, like you do with Farmville in facebook for instance. It's Flash and use the canvas provided in flash. It's that web-canvas I'm looking for, is that possible to create in .Net, Python or Ruby at all? If so, then I asssume you could use SFML through that language and canvas. In the end, that would enable me to play that game in any phone able to show homepages.

C: Or is there any other way to get a web-canvas? Perhaps using SFML for Python connected to a Java interface and using Java to show the built in canvas used by Java?

52
General / How do I bring an SFML game out on the Internet?
« on: October 22, 2011, 01:08:17 pm »
Quote from: "Laurent"

Python and Ruby are server-side languages, you won't be able to use them for online gaming.
 


Thanks for your fast answer. I had a lot of hope in store for Ruby and Python, and I'm having a bit of a major blonde moment now. If I have a server of my own, why can't I use Python/Ruby to host the games (with SFML as game library in the background)? And, since so much of the future in game developing is connected to iphone/Android system, isn't there any way to use the  SFML libraries for games based on those technologies?

53
General / How do I bring an SFML game out on the Internet?
« on: October 22, 2011, 12:32:43 pm »
I admit, when programming in different languages, I'm a beginner with C/Pascal knowledge given to me in the eighties and acute employed as a substitute C++ teacher this- and next semester. I'm having three classes in highschool (beginner/intermediate/advanced) where pupils are taught C++ and I decided to use SFML for the two more advanced classes to attract their interest for programming in a better way than just using the console window in vc++ which has always been the only choice in this school.

The main problem now for me is that several of my pupils want to make games they can put out for on-line gaming. I know that theoretically, it should be possible, even though C++ might not be the language of choice for it. It really doesn't have to either since they are learning "programming", the choice of using C++ in teaching programming was made long before I came to the school. And since I have to learn C++ well in advance to the pupils, I could aswell learn another programming language well in advance before the actual lessons I have.

When I look at the different versions of SFML, I see three different ones that might be the solution:

*.Net. It can be programmed through VC++, but if I make a game using SFML and .Net standard, how hard is it to make it on-line playable?

*Python, it's used as server side programming language and the same pupils whom I'm teaching how to program C++ are taught by me how to put up apache web servers too, so it shouldn't be that hard, I think. Or am I wrong? How hard is it to make an on-line playable game in Python using SFML if you have control over your own Apache server?

*Ruby. Is that the same as Ruby on rails? I have never used it and it seems to be hard to understand. Still, there is an SFML version for it. As far as I know, Ruby and Python are about the same and it seems that Python would be a better choice, but am I wrong on that?

If it's playable on the Internet this way, then it should also be playable in an Iphone or Android that can show homepages, or am I wrong there too? I hope someone with better knowledge than I can give some kind of answer to these questions.

And besides, since it's a school I'm working in, I can only use free alternatives, nothing that cost any kind of money.

54
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 11, 2011, 01:25:09 pm »
SOLVED!

Quote from: "Laurent"
You must disable precompiled headers, since you don't use them.


I wish I knew how to do it.

Anyway, I can make my own programs after several hours. Both the films from Youtube proved to have some errors in them.

As I found out, the first film only shows how to create debug versions of the files. Not the release versions. Makes it hard to see if you've never done it before. What to do? Solution
Compile:
 Debug_static= 6 ok
 Debug DLL = 5 ok 1 up to date
release_static 6 ok
release DLL = 5ok 1 up to date
Then, checking both release and debug alternatives (with no options) by hitting F7 shows 6 up to date in both cases.

Delete all files in <sfml>\lib and rename the folder there to vc2010.

Do not change the option (in release mode):
C/C++
  Code Generation
        Multi-threaded DLL(/MD)

Errors in the second film? Well, it is stated in the second Youtube clip that it should be changed to
Multi-threaded (/MT)
But that cause most of the, if not all the, errors. I honestly don't know the difference though.

Add C/C++
   Preprocessor
      Pre processor definitions

Fill in SFML_STATIC as the last option. Like this:
WIN32
NDEBUG
_CONSOLE
SFML_STATIC

Link C/C++
   General
     Additional Include Directories
to the include folder <sfml>\include

Link  Linker
    Additional Library Directories
to the re-named folder in lib vc2010
<sfml>\lib\vc2010

Add Linker
    Input
      Additional dependencies

sfml-system-s-d.lib
 sfml-window-s-d.lib
 sfml-graphics-s-d.lib

in debug mode and


sfml-system-s.lib
 sfml-window-s.lib
 sfml-graphics-s.lib

in release mode.

Now, it works.
I don't know if it could work better, but at least it works.  :D

If someone else is in the same situation, here is a dropbox link to the files, compiled for :
Windows 7 enterprise 64bit
Visual c++ 2010 express
SFML 2010
Just unpack the zip file (the whole sfml library with the compiled files) and make sure you link to the right libraries according to the instruction above.

Dropbox link:
http://dl.dropbox.com/u/8595437/w7enterprise_64__vs2010xp_sfml16.zip

55
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 11, 2011, 11:40:53 am »
To narrow it down
*I created a standalone folder.

*I put all <name>-s.lib
in a folder of their own named libs and pasted it into the standalone folder.

*I copied the original "include" folder from the re-compiled sfml 1.6 library and pasted it into the standalone folder.

*I linked to sfml-system-s.lib in:
 linker-input
additionaldependencies

*I linked to the copy-pasted include folder in: C/C++ Additional directories.

*I linked to the folder libs in: Linker-General: Additional Library Directories.

* I changed C/C++ Preprocessor Preprocessor definitions
and added: SFML_STATIC on top of the other.

* I changed C/C++ - Code generation: Runtime library to Multi-threaded (/MT)
__________________
After that, I added the code for the clock (as simple as possible) and got this output:

1>------ Build started: Project: testrelease, Configuration: Release Win32 ------
1>  stdafx.cpp
1>  testrelease.cpp
1>testrelease.cpp(1): warning C4627: '#include <SFML/System.hpp>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>testrelease.cpp(2): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>testrelease.cpp(15): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Frustrating, sooooo frustrating.

56
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 11, 2011, 10:36:31 am »
I found another video:

How to make SFML work on Visual C++ 2010[statically]

I recompiled the vc++ 2008 SDK to 2010 all according to the film. I realized that in the first film, creating the static release part wasn't shown. Now, I do have all sfml-name>-s.lib files. But it doesn't matter. Debug works fine, but in release mode, I get these (fewer) errors.

1>------ Build started: Project: sfml_klampe_test, Configuration: Release Win32 ------
1>msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __thiscall std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QAEPAV123@XZ) already defined in sfml-window-s.lib(WindowImplWin32.obj)
1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPAV123@@Z) already defined in msvcprt.lib(locale0_implib.obj)
1>libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPAV_Locimp@12@XZ) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPAV12@@Z) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@PBD@Z) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in msvcprt.lib(MSVCP100.dll)
1>libcpmt.lib(xlock.obj) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in msvcprt.lib(MSVCP100.dll)
1>LIBCMT.lib(_file.obj) : error LNK2005: ___iob_func already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(lconv.obj) : error LNK2005: _localeconv already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR100.dll)
1>LIBCMT.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRT.lib(MSVCR100.dll)
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
1>D:\Users\iwiklund\Documents\Visual Studio 2010\Projects\sfml_klampe_test\Release\sfml_klampe_test.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Isn't there anyone out there with the same setup as I that actually can make exe-files from sfml-projects? And can share how it's done? (please!).

57
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 08, 2011, 11:03:21 pm »
I tried to make it dynamic instead. ereased all text in: linker - input - additional directives to rule out all connections to missing files, After that, I copied all files that were sfml-<name>-d.dll to the projects debug library and all ¨sfml-<name>.dll to the release library.

Added #define SFML_DYNAMIC at the top and tried debug mode:
This actually works in static mode... Errors are:

1>------ Build started: Project: sfml ljudtestare, Configuration: Debug Win32 ------
1>  main.cpp
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: virtual void __thiscall sf::RenderTarget::Draw(class sf::Drawable const &)" (?Draw@RenderTarget@sf@@UAEXABVDrawable@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::SetFramerateLimit(unsigned int)" (?SetFramerateLimit@Window@sf@@QAEXI@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ) referenced in function "void __cdecl EndProgram(void)" (?EndProgram@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function "void __cdecl EndProgram(void)" (?EndProgram@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Sprite::SetImage(class sf::Image const &)" (?SetImage@Sprite@sf@@QAEXABVImage@2@@Z) referenced in function "void __cdecl Move(void)" (?Move@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function "void __cdecl Move(void)" (?Move@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Drawable::Move(float,float)" (?Move@Drawable@sf@@QAEXMM@Z) referenced in function "void __cdecl Move(void)" (?Move@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Input::IsKeyDown(enum sf::Key::Code)const " (?IsKeyDown@Input@sf@@QBE_NW4Code@Key@2@@Z) referenced in function "void __cdecl Move(void)" (?Move@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: class sf::Input const & __thiscall sf::Window::GetInput(void)const " (?GetInput@Window@sf@@QBEABVInput@2@XZ) referenced in function "void __cdecl Move(void)" (?Move@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Drawable::SetPosition(float,float)" (?SetPosition@Drawable@sf@@QAEXMM@Z) referenced in function "public: __thiscall BulletStruct::BulletStruct(void)" (??0BulletStruct@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Sprite::Sprite(void)" (??0Sprite@sf@@QAE@XZ) referenced in function "public: __thiscall Image::Image(void)" (??0Image@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::Drawable::~Drawable(void)" (??1Drawable@sf@@UAE@XZ) referenced in function "public: virtual __thiscall sf::Sprite::~Sprite(void)" (??1Sprite@sf@@UAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Sprite::SetSubRect(class sf::Rect<int> const &)" (?SetSubRect@Sprite@sf@@QAEXABV?$Rect@H@2@@Z) referenced in function "void __cdecl SkapaExplosion(int,int)" (?SkapaExplosion@@YAXHH@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z) referenced in function "void __cdecl `dynamic initializer for 'window''(void)" (??__Ewindow@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function "void __cdecl `dynamic initializer for 'window''(void)" (??__Ewindow@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'Clock''(void)" (??__EClock@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Image::~Image(void)" (??1Image@sf@@QAE@XZ) referenced in function __unwindfunclet$??0Data@@QAE@XZ$0
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Image::LoadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadFromFile@Image@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: __thiscall Data::Data(void)" (??0Data@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::Image::Image(void)" (??0Image@sf@@QAE@XZ) referenced in function "public: __thiscall Data::Data(void)" (??0Data@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'window''(void)" (??__Fwindow@@YAXXZ)
1>C:\Users\Teacher\documents\visual studio 2010\Projects\sfml ljudtestare\Debug\sfml ljudtestare.exe : fatal error LNK1120: 25 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

After that, I tried in release mode and got these errors:

1>------ Build started: Project: sfml ljudtestare, Configuration: Release Win32 ------
1>  main.cpp
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Drawable::Move(float,float)" (?Move@Drawable@sf@@QAEXMM@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Drawable::SetPosition(float,float)" (?SetPosition@Drawable@sf@@QAEXMM@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall sf::Drawable::~Drawable(void)" (??1Drawable@sf@@UAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(class sf::VideoMode,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,unsigned long,struct sf::WindowSettings const &)" (??0RenderWindow@sf@@QAE@VVideoMode@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@KABUWindowSettings@1@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Input::IsKeyDown(enum sf::Key::Code)const " (?IsKeyDown@Input@sf@@QBE_NW4Code@Key@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Image::LoadFromFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?LoadFromFile@Image@sf@@QAE_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Image::~Image(void)" (??1Image@sf@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Image::Image(void)" (??0Image@sf@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Window::SetFramerateLimit(unsigned int)" (?SetFramerateLimit@Window@sf@@QAEXI@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: class sf::Input const & __thiscall sf::Window::GetInput(void)const " (?GetInput@Window@sf@@QBEABVInput@2@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Window::GetEvent(class sf::Event &)" (?GetEvent@Window@sf@@QAE_NAAVEvent@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: bool __thiscall sf::Window::IsOpened(void)const " (?IsOpened@Window@sf@@QBE_NXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Window::Close(void)" (?Close@Window@sf@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Sprite::SetSubRect(class sf::Rect<int> const &)" (?SetSubRect@Sprite@sf@@QAEXABV?$Rect@H@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::Sprite::SetImage(class sf::Image const &)" (?SetImage@Sprite@sf@@QAEXABVImage@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Sprite::Sprite(void)" (??0Sprite@sf@@QAE@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall sf::RenderTarget::Draw(class sf::Drawable const &)" (?Draw@RenderTarget@sf@@UAEXABVDrawable@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: void __thiscall sf::RenderTarget::Clear(class sf::Color const &)" (?Clear@RenderTarget@sf@@QAEXABVColor@2@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z)
1>C:\Users\Teacher\documents\visual studio 2010\Projects\sfml ljudtestare\Release\sfml ljudtestare.exe : fatal error LNK1120: 25 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
(I cut away the rows with warnings saying I could loose informtion changing from float to int when I place sprites in the game).

In static mode, I can debug but not do a release build, in dynamic mode, I can do neither, any ideas what is wrong?

58
Graphics / Wwedish vowels in sf::Event::TextEntered, problem
« on: October 07, 2011, 09:49:24 pm »
Quote from: "Laurent"
Is this really your code?? Obviously not, Event.Type cannot be both TextEntered and KeyPressed.

I'd like to see your real code please.
 


Sad to say Mr Laurent, it was my original code. First, I didn't realize that TextEntered was an event type of its own but thought it was an event fired by key down. That code was buggy to say the least...

I did like this, in code and pseudo code to keep it short.
In this way, I' get the swedish wovels but reject anything but letters. I never used:
Code: [Select]
if ( Event.Text.Unicode < 0x80 ) // it's printable

Since I want a single word for hang man game (hardly more than 255 letters long :), it is sufficient for me.


lower2upper(char letterin); //= function to make an a char to an A char.
int i=0;
char tempchar;
char secretword[255];//the word you want to find out
char alphabet[30]{all the letters in the alphabet A-Ö and - for combined words};


if ( Event.Type == sf::Event::TextEntered)
 {
tempchar= ((char)Event.Text.Unicode;
tempchar = lower2upper(tempchar);
if (the charexists in the alphabet[]) //pseudocode
 {
 secretword = tempchar;
 i++
 }

}

59
General / Ok in debug mode but error in release (w7, 1.6 and vc 2010)
« on: October 07, 2011, 09:31:12 pm »
Environment
Windows 7 Enterprise 64
SFML 1.6
Visual C++ 2010 Express

When I installed SFML in vc2010 I have followed all instructions in this video:

and made everything work in debug mode and have had some joy in making games for some weeks now.

Today, when I tried to build my first project in release mode, something went wrong.
I get the error:
Code: [Select]
cannot open input file 'sfml-system-s.lib'

It's not that odd I suppose, since all sfml-<name>-s.lib vas deleted in the process of creating a 2010 express install from the 2008 express files, all according to the install video on Youtube.

Under the heading Linker - Additional Dependencies. In debug mode I have:
Code: [Select]
sfml-system-s-d.lib
sfml-window-s-d.lib
sfml-graphics-s-d.lib
sfml-audio-s-d.lib


And in release mode I have:

Code: [Select]
sfml-system-s.lib
sfml-window-s.lib
sfml-graphics-s.lib
sfml-audio-s.lib


but when I take a peek in my 2010 lib which is linked through heading:
Linker-Additional Library Directories C:\sfml16\SFML-1.6\lib\vc2010;%(AdditionalLibraryDirectories)

I do find the sfml-<name>-s-d.lib
 and sfml-<name>-d.lib, but no sfml-<name>-s.lib.

Any idea where things have gone wrong? I have tried to change Heading Linker EnableIncrementalLinking to no avail.

PS.
Under heading C/C++-General I have AdditionalIncludeDirectories C:\sfml16\SFML-1.6\include;%(AdditionalIncludeDirectories)
if that can be of any help.

60
Graphics / Wwedish vowels in sf::Event::TextEntered, problem
« on: October 07, 2011, 01:47:11 pm »
Sooo, just leaving it open and compare every character typed to a list with allowed character and store typed, allowed character in an array is the fastest hack, I assume? Then I don't have to typecast anything.

Pages: 1 2 3 [4] 5
anything