SFML community forums

Bindings - other languages => C => Topic started by: Crank1d on July 28, 2010, 08:46:18 pm

Title: Strange errors
Post by: Crank1d 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))
Title: Strange errors
Post by: Laurent on July 28, 2010, 10:30:01 pm
There are no constructors in C... ;)
Code: [Select]
sfVideoMode mode = {800, 600, 32};
sfWindowSettings settings = {24, 8, 0};
sfRenderWindow_Create(mode, "SFML", sfResize | sfClose, settings);
Title: Strange errors
Post by: Crank1d on July 28, 2010, 11:22:44 pm
Quote from: "Laurent"
There are no constructors in C... ;)
I feel ashamed.  :oops: I´m going to take my C lessons (again) right now.