我一直在尝试让 SFML 工作一段时间,并且一直在尝试使用 GCC 让它工作。顺便说一句,我在 OS X 上。我遵循标准的 Linux 说明并使用 Linux 64 位下载,但是在编译时...
g++ -o testing main.cpp -lsfml-system
有时候是这样的:
main.cpp: In function ‘int main()’:
main.cpp:7: error: ‘class sf::Clock’ has no member named ‘GetElapsedTime’
main.cpp:9: error: ‘class sf::Clock’ has no member named ‘GetElapsedTime’
main.cpp:10: error: ‘Sleep’ is not a member of ‘sf’
所以我认为这可能是由于没有使用包含,所以我将我的 gcc 编译命令更改为:
g++ -o testing main.cpp -I ~/SFML-1.6/include/ -lsfml-system
现在我收到了这个错误:
ld: warning: ignoring file /usr/local/lib/libsfml-system.so, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"sf::Clock::Clock()", referenced from:
_main in ccZEiB7b.o
"sf::Clock::GetElapsedTime() const", referenced from:
_main in ccZEiB7b.o
"sf::Sleep(float)", referenced from:
_main in ccZEiB7b.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status**
而且我不知道该怎么做才能解决它。