错误信息:
[root@localhost SDL]# g++ a.cpp `sdl-config --libs --cflags`
a.cpp: In constructor 'test::test()':
a.cpp:19: error: argument of type 'int (test:(void*)' does not match 'int (*)(void*)'
}
[/code:1]
这个可以,但把friend改成static编译时就报错
/cygdrive/c/DOCUME~1/GUOYON~1/LOCALS~1/Temp/ccIyEo2w.o(.text+0x1:a.cc: undefined reference to `test::callback(void*)'
/cygdrive/c/DOCUME~1/GUOYON~1/LOCALS~1/Temp/ccIyEo2w.o(.text+0x44):a.cc: undefined reference to `test::callback(void*)'
collect2: ld returned 1 exit status