Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Error about GLchar * in Release Mode
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Error about GLchar * in Release Mode

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wwolff
    wrote on last edited by wwolff
    #1

    Hi!

    I have a function decleared as:

    iglSetaUniformVec4(GLchar *nome,CIMTVetor4 vlr)

    This function only receives a GLchar pointer and a vector to setup a shader uniform.

    In the program i´m calling this function like this:

    iglSetaUniformVec4 ("cor_diffusa_mat" ,CorDifusa );

    The function works very well , but only in Debug Mode, when i switch to Release Mode i receive the following error:

    ......\INS3D\src\INSGL\IGL_FunctionsPCv43.cpp(171) : error C2664: 'bool CIGLFunctionsPCv43::iglSetaUniformVec4(GLchar *,CIMTVetor4)' : cannot convert argument 1 from 'const char [16]' to 'GLchar *'
    Conversion from string literal loses const qualifier (see /Zc:strictStrings)

    My doubt is, why this error happen only in release mode?
    i Will need change all my parameter to QString and when i send the name to OpenGL uses the c_str() method to send the string to OpenGL?(Since all methods in OpenGL are defined as GLchar * ?)

    Kind Regards.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Harism
      wrote on last edited by
      #2

      @wwolff said:

      iglSetaUniformVec4(GLchar *nome,CIMTVetor4 vlr)

      I'm rather sure you could use const GLchar * here instead to overcome the compile problem.

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wwolff
        wrote on last edited by
        #3

        Hi!

        Thanks so Much!
        Works Lovelly!

        Kind Regards.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved