Leave these fields empty (spam trap):
You can leave this blank to post anonymously, or you can create a Tripcode by using the format Name#Password
[i]Italic Text[/i]
[b]Bold Text[/b]
[spoiler]Spoiler Text[/spoiler]
>Highlight/Quote Text
[pre]Preformatted & Monospace Text[/pre]
[super]Superset Text[/super]
[sub]Subset Text[/sub]
1. Numbered lists become ordered lists
* Bulleted lists become unordered lists


Discord Now Fully Linked With 420chan IRC

Getting glew to work on windows in codeblocks

- Thu, 26 Jul 2018 20:44:01 EST u5b/OYZE No.37598
File: 1532652241078.gif -(633689B / 618.84KB, 474x266) Thumbnail displayed, click image for full size. Getting glew to work on windows in codeblocks
I have a question about something not working in my coding. Normally in these situations this calls for throwing out some easy answers with a healthy dose of derision and scorn.

One: What must i do to convince you that i have tried my best to solve this before coming to you?

Two: I request someone to walk me through the solution to this problem like a parent dragging a young child through a busy city street. I have worked at this for so long, that i am starting to lose confidence i ever knew anything at all, and i consider it fully possible that i am missing something on the level of "Is the cord plugged in?"

Okay, here's the problem. I am learning openGL. I am using this website to do it: https://learnopengl.com/, i am currently walking through their 2D game tutorial shown here: https://learnopengl.com/In-Practice/2D-Game/Setting-up and i cannot, for the life of me, get glew to work.
I am on windows. I am using codeblocks. When i do everything i know should work, i get a shit load of undefined reference errors.


That says to me that i am somehow linking to the glew library wrong. But i have been trying fookin' EVERYTHING. Literal days. Possibly months, because this isn't the first time i've tried to tackle this - i think i gave up on codeblocks last time and just used visual studio, because for some reason that works easier - but i don't know why and that's terrible for learning.

When i DONT use glew, i can make openGL programs just fine. Hell, given how much time i've invested in this, and how it's likely that there is NO solution known to god or man, i'm probably better off just figuring out what the tutorial is trying to do and figure out how to translate it OUT of glew than get glew to work. But the fact that it SHOULD work and i can't get it to is making my brains leak out of my HEAD.

So if you believe me that i wouldn't be asking you if i could find a (WORKING)solution anywhere on google, or glew's support pages, or shit like that. Please please please tell me how to fucking do this.
Oliver Shittingstone - Thu, 26 Jul 2018 21:28:45 EST u5b/OYZE No.37599 Reply
Okay so, i've tried downloading the binaries from http://glew.sourceforge.net/, it gives me some libs and some includes.

I've tried including each lib. I've tried glew32.lib, i've tried glew32s.lib and including #DEFINE GLEW_STATIC. I tried it for both win32 and x64.

I tried putting the glew.lib at the top list of libraries to include.

I tried putting everyone of the 4 at the top of the list. I've tried putting glew32 and glew32s in the list. I've tried linking the dll in the codeblocks linker list, i've tried linking glew32 while the dll was in the same file as the *.cpp file, and i tried it with the glew32s lib.

I see online in some places that there is a glew.c file though? But it's not in the precompiled binary you get from http://glew.sourceforge.net/ , so i am not sure if you're supposed to include it in the project. I haven't seen anywhere somebody saying you should add glew.c to your project. It is in the source code zip. And i did try downloading that and adding to my project, and it adds more errors but doesn't fix existing errors including all the undefined reference errors.

What i haven't tried THIS time - pretty sure i've tried it in the past, is i haven't tried building glew myself in codeblocks on windows with the mingw compiler.

I figure that MIGHT be the key, since i am pretty sure i can get glew to work for visual studio, with its compiler, because for some reason tutorials love working with visual studio and hate codeblocks, so it's like an afterthought, and the main difference i can think of is the different compilers each program uses.

But i am pretty sure i've tried doing this in the past and couldn't figure out how to do it. If someone wants to walk me through trying that, that might be a good first thing to try.
Jenny Brablingdock - Thu, 26 Jul 2018 21:33:30 EST Xm/W+3lL No.37600 Reply
It looks to me like all of your linker errors are actually for OpenGL functions. Did you try linking both GLEW and OpenGL in your program at the same time?

Alternatively, if you can't get GLEW linking properly, you could try compiling GLEW yourself from source (since it's an open-source library) and seeing if you can get your program to work that way (linking against GLEW's locally-compiled object files rather than linking against a GLEW library that someone made).

Also if you are on Windows then you should use Visual Studio Community Edition now that it's free and nearly as fully-featured as the pro versions (unlike previous versions of Visual Studio, such as Visual Studio Express, which were stripped-down pieces of poop). I've used both Code:Blocks and Visual Studio in the past and VS is far superior (especially if you plan to do professional programming on Windows).

Good luck! :)
Oliver Shittingstone - Thu, 26 Jul 2018 21:58:57 EST u5b/OYZE No.37602 Reply

I have tried linking glew and openGL at the same time. OpenGL has been linked during every experiment i tried. And i know it's connected correctly because when i am not using glew - when i am running earlier tutorials like https://learnopengl.com/Getting-started/Coordinate-Systems , it works fine. But note, glew isn't used in that program.

I haven't yet tried(this time) compiling my own glew. I will try that now.

However i have no intention on using visual studio. I really really dislike it. Not for a good reason. For a really petty reason. It feels... bulky to me. No specific thing. Just it feels like codeblocks is like using a violin, and using visual studio feels like using an accordion. Every time i've got in coding moods in the past, i end up stopping because i HAVE to use visual studio, and i just really don't like it.
Oliver Shittingstone - Thu, 26 Jul 2018 22:58:00 EST u5b/OYZE No.37603 Reply
Okay, i am having serious difficulty figuring out how to build glew on windows in codeblocks.

It basically seems that EVERYTHING IN THE WEEERLD is designed with the notion in mind that codeblocks is only for non-windows systems, and windows systems should only be using visual studio.

Also, i may have bumbled into successfully building the glew library, but it's in the form of "libglew32.a", which i've never been clear on whether that format is usable by windows or if it's a linux only format.

Can i link against somethingSometh.a on a windows machine and have it work like a somethingSometh.lib?
Angus Diblingson - Thu, 26 Jul 2018 23:56:35 EST +i3Wkb0r No.37604 Reply
>It basically seems that EVERYTHING IN THE WEEERLD is designed with the notion in mind that codeblocks is only for non-windows systems, and windows systems should only be using visual studio.

I have no idea how to build things on Windows except with MSYS2, which Google says you can use to build GLEW.
Oliver Shittingstone - Fri, 27 Jul 2018 00:17:18 EST u5b/OYZE No.37605 Reply

Okay, but will that create lib files, or files intended to be used on windows systems, or will it create a files, or files intended to be used on unix systems?
Jenny Brablingdock - Fri, 27 Jul 2018 03:30:47 EST Xm/W+3lL No.37606 Reply
You could try using the mingw compiler directly from the command-line to compile and link your code. Alternatively, you could try using Clang from the command-line to compile and link your code.

Both of these should work on Windows (provided you make sure to download the version of Clang that builds on Windows for Windows, as opposed to the version of Clang that builds on Windows for Linux).

Report Post
Please be descriptive with report notes,
this helps staff resolve issues quicker.