मैं some tutorials on OpenGL कर रहा हूं जो FreeGLUT का उपयोग करता है।क्या मैक ओएस एक्स पर फ्रीग्लूट बनाना संभव है?
CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../"
make
make install
दुर्भाग्य से यह अपने आप ही मुझे एक त्रुटि देता है जब मैं make
आदेश कार्य करें:: Undefined symbols for architecture x86_64
काम की abit करने के बाद
Apparently इस आप कैसे निर्माण और पर मैक इसे स्थापित है मैंने पाया कि पहली पंक्ति पर एक सुधार है:
CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/lib" ./configure --prefix="${PWD}/../"
दुर्भाग्य से जब मैंकरनाआदेश मैं अभी भी एक त्रुटि हो रही है:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/X11R6/include -L/usr/X11R6/lib -I../../../include -g -O2 -Wall -pedantic -MT smooth_opengl3-smooth_opengl3.o -MD -MP -MF .deps/smooth_opengl3-smooth_opengl3.Tpo -c -o smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo './'`smooth_opengl3.c
smooth_opengl3.c:101: error: redefinition of typedef ‘PFNGLGENBUFFERSPROC’
/usr/X11R6/include/GL/glext.h:5080: error: previous declaration of ‘PFNGLGENBUFFERSPROC’ was here
smooth_opengl3.c:102: error: redefinition of typedef ‘PFNGLBINDBUFFERPROC’
/usr/X11R6/include/GL/glext.h:5078: error: previous declaration of ‘PFNGLBINDBUFFERPROC’ was here
smooth_opengl3.c:103: error: redefinition of typedef ‘PFNGLBUFFERDATAPROC’
/usr/X11R6/include/GL/glext.h:5082: error: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
smooth_opengl3.c:104: error: redefinition of typedef ‘PFNGLCREATESHADERPROC’
/usr/X11R6/include/GL/glext.h:5197: error: previous declaration of ‘PFNGLCREATESHADERPROC’ was here
smooth_opengl3.c:105: error: redefinition of typedef ‘PFNGLSHADERSOURCEPROC’
/usr/X11R6/include/GL/glext.h:5222: error: previous declaration of ‘PFNGLSHADERSOURCEPROC’ was here
smooth_opengl3.c:106: error: redefinition of typedef ‘PFNGLCOMPILESHADERPROC’
/usr/X11R6/include/GL/glext.h:5195: error: previous declaration of ‘PFNGLCOMPILESHADERPROC’ was here
smooth_opengl3.c:107: error: redefinition of typedef ‘PFNGLCREATEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5196: error: previous declaration of ‘PFNGLCREATEPROGRAMPROC’ was here
smooth_opengl3.c:108: error: redefinition of typedef ‘PFNGLATTACHSHADERPROC’
/usr/X11R6/include/GL/glext.h:5193: error: previous declaration of ‘PFNGLATTACHSHADERPROC’ was here
smooth_opengl3.c:109: error: redefinition of typedef ‘PFNGLLINKPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5221: error: previous declaration of ‘PFNGLLINKPROGRAMPROC’ was here
smooth_opengl3.c:110: error: redefinition of typedef ‘PFNGLUSEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5223: error: previous declaration of ‘PFNGLUSEPROGRAMPROC’ was here
smooth_opengl3.c:111: error: redefinition of typedef ‘PFNGLGETSHADERIVPROC’
/usr/X11R6/include/GL/glext.h:5209: error: previous declaration of ‘PFNGLGETSHADERIVPROC’ was here
smooth_opengl3.c:112: error: redefinition of typedef ‘PFNGLGETSHADERINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5210: error: previous declaration of ‘PFNGLGETSHADERINFOLOGPROC’ was here
smooth_opengl3.c:113: error: redefinition of typedef ‘PFNGLGETPROGRAMIVPROC’
/usr/X11R6/include/GL/glext.h:5207: error: previous declaration of ‘PFNGLGETPROGRAMIVPROC’ was here
smooth_opengl3.c:114: error: redefinition of typedef ‘PFNGLGETPROGRAMINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5208: error: previous declaration of ‘PFNGLGETPROGRAMINFOLOGPROC’ was here
smooth_opengl3.c:115: error: redefinition of typedef ‘PFNGLGETATTRIBLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5206: error: previous declaration of ‘PFNGLGETATTRIBLOCATIONPROC’ was here
smooth_opengl3.c:116: error: redefinition of typedef ‘PFNGLVERTEXATTRIBPOINTERPROC’
/usr/X11R6/include/GL/glext.h:5280: error: previous declaration of ‘PFNGLVERTEXATTRIBPOINTERPROC’ was here
smooth_opengl3.c:117: error: redefinition of typedef ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’
/usr/X11R6/include/GL/glext.h:5202: error: previous declaration of ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’ was here
smooth_opengl3.c:118: error: redefinition of typedef ‘PFNGLGETUNIFORMLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5212: error: previous declaration of ‘PFNGLGETUNIFORMLOCATIONPROC’ was here
smooth_opengl3.c:119: error: redefinition of typedef ‘PFNGLUNIFORMMATRIX4FVPROC’
/usr/X11R6/include/GL/glext.h:5242: error: previous declaration of ‘PFNGLUNIFORMMATRIX4FVPROC’ was here
make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
यह documented on the net before कर दिया गया है, लेकिन समाधान वास्तव में यह सब इस उदाहरण में उपयोगी नहीं है। मैंने ओएस एक्स के साथ आने वाले GLUT.framwork के लिए इसे स्वैप करने का भी प्रयास किया है, लेकिन उदाहरण फ्रीग्लूट-विशिष्ट फ़ंक्शंस का उपयोग कर रहे हैं।
ठीक है, मैं इस में एक छोटे से आगे मिल गया है। 'CPPFLAGS =" का उपयोग करना - I/usr/X11R6/include -L/usr/X11R6/lib "./configure --prefix =" $ {PWD} /../ "' अपरिभाषित प्रतीकों 'त्रुटि से छुटकारा पाता है। लेकिन अब मुझे 'ld: लाइब्रेरी नहीं मिली- lGL' \' collect2: ld 1 निकास स्थिति लौटा दी \ 'बनाने [2]: *** [libglut.la] त्रुटि 1' \ 'बनाना [1]: * ** [सभी-पुनरावर्ती] त्रुटि 1'/'बनाना: *** [सभी] त्रुटि 2' – bjz
शायद आपको एलडीएफएलजीएस, '-L/usr/X11R6/lib' के साथ भी जांच करनी चाहिए। – ZhangChn
ओह धन्यवाद। ठीक है तो मैंने 'CPPFLAGS =" - I/usr/X11R6/include -L/usr/X11R6/lib "LDFLAGS =" - L/usr/X11R6/lib "./configure --prefix =" $ {PWD}/../ "और मैंने पिछली त्रुटि से छुटकारा पा लिया। अब मुझे 'smooth_opengl3.c: 101: लाइनों की त्रुटियों के साथ त्रुटियों का पूरा भार मिलता है: त्रुटि: टाइप किए गए 'पीएफएनजीएलजीएनबीएफएफएफएसआरआरसीसी' \ '/usr/X11R6/include/GL/glext.h:5080: त्रुटि की पुन: परिभाषा: पिछली घोषणा 'PFNGLGENBUFFERSPROC' यहां – bjz