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.


Topics - Crank1d

Pages: [1]
1
C / Strange errors
« on: July 28, 2010, 08:46:18 pm »
I´m getting these 2 errors that are strange, because everything is written OK.

main.c
Code: [Select]
#include <SFML/Graphics.h>

int main()
{
sfRenderWindow_Create(sfVideoMode(800,600,32), "SFML", sfResize | sfClose, sfWindowSettings());
return EXIT_SUCCESS;
}


errors
Code: [Select]
1>.\main.c(6) : error C2143: syntax error : missing ')' before 'type'
1>.\main.c(6) : error C2198: 'sfRenderWindow_Create' : too few arguments for call


Don´t know if it is because of CSFML or some project options need to be set (using VC2005, compiling as "C" code(but it also happens if compiled as "C++" code))

2
C / VS2005 linking error: unresolved external symbol
« on: July 25, 2010, 04:38:29 pm »
I´ve just started with CSFML and i am getting linking errors everytime i try to compile my app (i am using Visual Sudio 2005, as i´ve said in title).
I´ve included all needed libraries for app (csfml-audio.lib, csfml-graphics.lib, csfml-network.lib, csfml-system.lib, csfml-window.lib). Here is the code:

SoundSystem.h
Code: [Select]
#include <SFML/Audio.h>
#include "DataTypes.h"

// sound
extern void PlayMusic(C8 *FileName);


SoundSystem.cpp
Code: [Select]
#include "DataTypes.h"
#include "SoundSystem.h"

sfMusic *Music;

void PlayMusic(C8 *FileName)
{
sfMusic_CreateFromFile(FileName);
sfMusic_Play(Music);
// Loop while the music is playing
while(sfMusic_GetStatus(Music) == sfPlaying)
{
sfSleep(0.1f);
}
}


main.cpp
Code: [Select]
#include "SoundSystem.h"

int main()
{
PlayMusic("data/sound.ogg");
return EXIT_SUCCESS;
}


...and here are the linking errors.
Code: [Select]
1>Compiling...
1>main.cpp
1>SoundSystem.cpp
1>Linking...
1>SoundSystem.obj : error LNK2001: unresolved external symbol "void __cdecl sfMusic_Play(struct sfMusic *)" (?sfMusic_Play@@YAXPAUsfMusic@@@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "void __cdecl sfSleep(float)" (?sfSleep@@YAXM@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "struct sfMusic * __cdecl sfMusic_CreateFromFile(char const *)" (?sfMusic_CreateFromFile@@YAPAUsfMusic@@PBD@Z)
1>SoundSystem.obj : error LNK2001: unresolved external symbol "enum sfSoundStatus __cdecl sfMusic_GetStatus(struct sfMusic *)" (?sfMusic_GetStatus@@YA?AW4sfSoundStatus@@PAUsfMusic@@@Z)
1>..\bin32\game_c.exe : fatal error LNK1120: 4 unresolved externals


I don´t know if i´ve forgot to set some options to compiler or forgot to include some file... so i´m looking for a help.

3
Window / Combined event types
« on: March 12, 2010, 05:51:33 pm »
I am new to SFML, so I still learn new stuff about library everyday but I am interested is it possible to combine event types? For example, i want to create rotational camera with OpenGL which user rotates when he press right mouse button and moves mouse. Ive tried something like this:

Code: [Select]
if ((Event.Type == sf::Event::MouseButtonPressed || sf::Event::MouseMoved) && (sf::Mouse::Right))


but it doesn´t do nothing.
If needed, I would post whole source code of application.

Pages: [1]