c++ - SDL: Undefined symbols for architecture x86_64 -
i'm working on simple wrapper sdl function sort of game engine. @ moment have simple temporary main function looks this:
#include <iostream> int main(int argc, char * argv[]) { std::cout << "still in development!\n"; return 0; }
along simple functions wrapper:
#include "sdl.h" namespace snowshoe { void initialize() { sdl_init(sdl_init_everything); } void release() { sdl_quit(); } void update(sdl_surface * screen) { sdl_flip(screen); } }
but when try compile 2 following error:
undefined symbols architecture x86_64: "_sdl_flip", referenced from: snowshoe::update(sdl_surface*) in snowshoe-iru.o "_sdl_init", referenced from: snowshoe::initialize() in snowshoe-iru.o "_sdl_quit", referenced from: snowshoe::release() in snowshoe-iru.o ld: symbol(s) not found architecture x86_64 collect2: ld returned 1 exit status
before asks, i've included flags need:
`sdl-config --cflags` -lsdl
any ideas? i'm running osx mountain lion , compiling command line (not xcode).
try `sdl-config --cflags --libs`
on system gives
-i/usr/include/sdl -d_gnu_source=1 -d_reentrant -l/usr/lib/x86_64-linux-gnu -lsdl
for example, do
g++ fractal.cpp -o3 -fopenmp -mavx `sdl-config --cflags --libs` -o fractal_gcc_avx
Comments
Post a Comment