Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
error running first example (chapter 3 triangle)
#11
Hi DieSkaarj

nice to see you here.

Ok well the 1st and most obvious thing is that you have an error on line 6 of your vertex shader, its as simple as that, it might be a missing ; on line 5, or a spelling error/upper lower case mistake on line 6 itself but for sure thats an error, which stops the shaders compiling and prevents you moving forward

can you double check? if you can't see it feel free to zip up the code and send it to me I'll check it out.

I've never used Geany but VisualGDB is actually using g++ so as long as you are using the right include paths it should work ok, if a little slow.

where is it finding this int32_t success = 0; line?
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#12
(06-07-2018, 05:29 PM)DieSkaarj Wrote: Hi I'm also experiencing this problem except that changing the GL driver to Legacy gives me a new error:

Error linking program:
ERROR:LEX/PARSE-2 (vertex shader, line 6) Undefined identifier.

I'm going to try flashing a new card with a fresh install of Raspian and if that doesn't work I'll try the mesa work around.

Also it might be worth noting that I'm using Geany and g++ to compile the code and although it's compiling it's also finding error with the declaration of "int32_t success = 0;" and is saying it's unused. I've also tried compiling on Visual Studio and VisualGDB but that just returns the original failed to add service message.

I suspect the in32_t error is due to warning levels, if Geany is providing some g++ defaults and you are treating warnings as errors, then the fact success is not used will indeed throw an error. Just comment it out, its a bit of a throwback line of code and not really needed.

I don't really like using "treat warnings as errors" even though in a professional settings, its generally good practice, however since we're using libs from 3rd parties we may not be able to fix all warnings, so try to find the option to set them to normal levels of 0-3

Let me know how you get on?
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply
#13
(06-08-2018, 12:45 AM)Brian Beuken Wrote:
(06-07-2018, 05:29 PM)DieSkaarj Wrote: Hi I'm also experiencing this problem except that changing the GL driver to Legacy gives me a new error:

Error linking program:
ERROR:LEX/PARSE-2 (vertex shader, line 6) Undefined identifier.

I'm going to try flashing a new card with a fresh install of Raspian and if that doesn't work I'll try the mesa work around.

Also it might be worth noting that I'm using Geany and g++ to compile the code and although it's compiling it's also finding error with the declaration of "int32_t success = 0;" and is saying it's unused. I've also tried compiling on Visual Studio and VisualGDB but that just returns the original failed to add service message.

I suspect the in32_t error is due to warning levels, if Geany is providing some g++ defaults and you are treating warnings as errors, then the fact success is not used will indeed throw an error. Just comment it out, its a bit of a throwback line of code and not really needed.

I don't really like using "treat warnings as errors" even though in a professional settings, its generally good practice, however since we're using libs from 3rd parties we may not be able to fix all warnings, so try to find the option to set them to normal levels of 0-3

Let me know how you get on?

Thanks Brian. I've got it working! Big Grin

So I didn't realize that the vertex shader was declared in this file and I got baffled looking at line 6 which, in my file, is: include <assert.h>. This led me to think that the vertex shader was external. The only other experience I have with OpenGL shaders at this point is messing around with them in emulators. One typo-correction later and after much trial and error (found on line 2 of the descriptor) and it compiled fine to then display a wonderful pi-powered polygon.

You're most definitely right about the all warnings thing, however it just fueled my idea that the vertex shader was some hidden file cached away in the darkest recesses of the Raspbian file structure. Smile
Reply
#14
Not in the early examples, the shaders are hard coded in the openGL init, later we will use a shader manager and load individual shaders as needed.
Shaders are not usually hidden away since we write them for our needs, its just a case of using the simplest approach of embedding them in the code until we're ready to explore.


Really pleased you worked it out, keep bashing away.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's 



Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)