c++ - Trying to port a game to Linux, calling XInitThreads gets me a syntax error -


here's how offending line looks in code:

#ifdef sfml_system_linux     xinitthreads(); #endif 

i've invoked requisite libraries @ beginning of code follows:

#ifdef sfml_system_linux     #include <x11/xlib.h>;     #include <unistd.h>     #include <pwd.h>     #include <iostream>     #include <stdlib.h> #endif 

it gives me error in code::blocks:

error: expected constructor, destructor, or type conversion before ‘;’ token

this error references line 111 in code, xinitthreads call in first function quoted above.

am missing something? i've tried setting linker include x11 library, far hasn't changed anything.

edit: here's more code beginning of game.cpp - http://pastebin.com/7d2wlrm7

it seems you're trying "call" function outside of function or method block.

your compiler can't understand you're trying do. move these lines game::init perhaps?


Comments