先用C寫, 然後改寫成Perl + POGL其實還蠻簡單 (畫了小茶壺的感想)
於是開始翻OpenGL super bible, 跟著書本一路跑
沒想到第一個code就出事了, GLTools.cpp老是compile不過
共出現1個warning和數個error
查了查有了結果
1. format not a string literal and no format arguments
網路上說是gcc的問題
沒關係, 如果是因為輸出格式沒填寫的話, 補上就可以了
fprintf(stderr, infoLog);
改成
fprintf(stderr, "\n%s\n", infoLog);
2. jump to label from here crosses initialization...
這個是因為使用了if (exp) goto , 但是 goto後面的statement沒有用else包起來導致
改掉了就解決了
詳情可以參考這邊
沒有留言:
張貼留言