Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9040345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:57:47+00:00 2026-06-16T09:57:47+00:00

I have recently migrated from Windows to Linux (Debian, 64-bit) and am trying to

  • 0

I have recently migrated from Windows to Linux (Debian, 64-bit) and am trying to get a GPGPU development environment up and running, so I am testing a program which worked under Windows.

Compiling and linking goes fine, but when I run the program I get some odd errors. I am using glew and freeglut.

First snippet: OpenGL only

i = 1;
info = PROGRAM_NAME;
glutInitContextVersion(4,2);
glutInit(&i, &info);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(W_SIZEX, W_SIZEY);
glutInitWindowPosition(W_POSX, W_POSY);
glutCreateWindow(info);
glClearColor(1.0,1.0,1.0,0);
/**/
printf("Before glewInit: %i\n", glGetError());
/**/    
printf("glewInit returns: %i\n", glewInit());
/**/
printf("After glewInit: %i\n", glGetError());
/**/

From which I get the following output:

Before glewInit: 0
glewInit returns: 0
After glewInit: 1280

This is an invalid enum error. I don’t know what’s causing it, but I suspect it might be related to the next error I get, later in the program’s execution.

Second snippet: OpenCL-OpenGL interop

/* BUFFERS */
(*BFR).C[0] = clCreateBuffer(*CTX, CL_MEM_READ_WRITE, SD, 0, 0);
(*BFR).C[1] = clCreateBuffer(*CTX, CL_MEM_READ_WRITE, SD, 0, &i);
dcl(i);

glGenBuffers(2, (*BFR).G);

glBindBuffer(GL_ARRAY_BUFFER, (*BFR).G[0]);
glBufferData(GL_ARRAY_BUFFER, SI, 0, GL_DYNAMIC_DRAW);
(*BFR).D[0] = clCreateFromGLBuffer(*CTX, CL_MEM_WRITE_ONLY, (*BFR).G[0], &i);
dcl(i);
glBindBuffer(GL_ARRAY_BUFFER, 0);

Here, the dcl(int) method just decodes the CL error code. When I run this, I get a CL_INVALID_GL_OBJECT error from clCreateFromGLBuffer(). However, OpenGL has no issues generating, binding or unbinding the buffers in question. The OpenCL context is apparently valid, generating no errors on creation or query. Everything works in VS2010 on Windows 7 64-bit.

Compilation Details

Here are the relevant includes:

/* OPENGL */
#include "GL/glew.h"
#include "GL/freeglut.h"

/* OPENCL */
#include "CL/cl.h"
#include "CL/cl_gl.h"

I am using GCC and linking like so:

gcc -w -I./include CLGL.c -o ~/Templates/GOL-CLGL/run/a.out -lGLEW -lGLU -lglut -lGL -lOpenCL;

Compilation and linking results in no errors (plenty of warnings about pointer abuse but I doubt that’s the culprit).

I’m currently out of ideas on how to debug this. Can anyone suggest further steps?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:57:48+00:00Added an answer on June 16, 2026 at 9:57 am

    I had this issue recently too so here is the answer:

    OpenGL: glGetError() returns invalid enum after call to glewInit()

    So you can discard that error .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently migrated from a Windows to Linux server... now I am getting a
I have recently migrated from a 32bit environment to a 64bit one, and it
We have a setup with a development trunk in our recently-migrated-to-from-VSS TFS system and
We have a 3.5 Gb SVN repository recently migrated from a 6 Gb one.
I have recently had a linux server compromised from bots uploading .php scripts and
I recently migrated a database from sql server 2005 to 2008 on windows server
I have recently migrated my MVC application from Visual Studio 2010 to Visual Studio
Recently I have migrated my project from SQLServer 2000 to MySQL 5.2 using MySQL
I have recently migrated my code from Rails 2.3.4 to rails 3 and started
We are recently migrated from CVS to SVN and I have setup SVN WebDAV

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.