编译Opengl和过剩的问题

时间:2014-11-10 13:51:08

标签: c opengl glut

我正在尝试在我的imac上编译一个程序,它使用opengl和glut来运行神经网络。 我正在使用框架为mac编译opengl和过剩,但我仍然得到这个错误。我有一种感觉,我错过了一些编译库。

这是输出:

$ gcc gpu.c -o gpu -lfann -lm -framework OpenGL -framework GLUT
Undefined symbols for architecture x86_64:
  "_copyMaskToTexture", referenced from:
      _main in gpu-cb634f.o
  "_copyVectorToTexture", referenced from:
      _main in gpu-cb634f.o
  "_copyWeightsToTexture", referenced from:
      _main in gpu-cb634f.o
  "_destroyLayer", referenced from:
      _main in gpu-cb634f.o
  "_generateLayer", referenced from:
      _main in gpu-cb634f.o
  "_init", referenced from:
      _main in gpu-cb634f.o
  "_initOpenGL", referenced from:
      _main in gpu-cb634f.o
  "_printLayer", referenced from:
      _main in gpu-cb634f.o
  "_run", referenced from:
      _main in gpu-cb634f.o
     (maybe you meant: _run_time)
  "_setInput", referenced from:
      _main in gpu-cb634f.o
  "_setOutput", referenced from:
      _main in gpu-cb634f.o
  "_test", referenced from:
      _main in gpu-cb634f.o
ld: symbol(s) not found for architecture x86_64

1 个答案:

答案 0 :(得分:1)

我认为你没有包含正确的代码或库。

看起来,就像您的代码与FANN库相关,但链接的页面显示:

  

代码仍然是完整的,并未包含在FANN库中,但如果用户愿意,可供用户试用。

因此,您的-lfann无法帮助您定义这些功能,您还需要其他功能。