C++ SOIL OpenGL issues

Whenever I try to create a texture in Dev C++ (5.2.0.1) using SOIL and code that looks like this:
1
2
3
4
5
6
texture[0] = SOIL_load_OGL_texture (
		"test.bmp",
		SOIL_LOAD_AUTO,
		SOIL_CREATE_NEW_ID,
		SOIL_FLAG_INVERT_Y
		);

I get this error:
[Linker error] main - textures.o:main - textures.cpp:(.text+0xd6): undefined reference to `SOIL_load_OGL_texture'

I have already included SOIL, so I tried to manually link the library, and I get MANY more errors, such as:
[Linker error] ../../../../../../../../../../Program Files (x86)/Dev-Cpp/MinGW32/lib/SOIL.lib(Debug/stb_image_aug.obj):(.text[_convert_format]+0x5b): undefined reference to `_RTC_CheckEsp'

and
.drectve `/DEFAULTLIB:"MSVCRTD" /DEFAULTLIB:"OLDNAMES" /EDITANDCONTINUE ' unrecognized

These errors were not there before. And ideas and/or help is appreciated.
U get these errors normally when u forget to mention the namespace:
try:
using xyznamespace;
or
xyznamespace::ur required fun or attr
I tried with Dev-C++ 5.2.0.2 TDM x64, and GL\glext.h was missing (which was needed to compile test_SOIL.cpp). But it does have GL\glaux.h, go figure.

Other than that, I can't tell where your linker errors are coming from.
Did you try putting the library in the same folder as the source code, and adding it to the project?
Project Options -> Parameters -> Add Library or Object

Now as for Orwell's Dev-C++. I think some of the higher-postcount members can confirm I've always been a big fan... until recently, when I realized 5.1+ was so full of bugs, I could start a zoo.

So how about a change, as Obama would say?
Last edited on
@anirudh sn:
I treid using namespace xyznamespace, but I got this error:
15 17 C:\Users\*my_username*\Other\flashdrive\other\MyWeb\C++\tools\OPENGL\textures\main - textures.cpp [Error] 'xyznamespace' is not a namespace-name

You're REQUIRED fun or attr?? I never used either. If it helps, my includes are:
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <stdlib.h>
#include <windows.h>
#include <stdio.h>
#include <GL/GLU.h>
#include "SOIL.h"

#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif 






@Catfish2:
I tried, but it gave my the same issues as when I tried to link the library in Dev C++'s bin. However, I'm running MinGW...
Last edited on
Topic archived. No new replies allowed.