Sign in to follow this  
giugio

wild magic 4 and opengl jpg texture

Recommended Posts

Hy. I have compiled and inherited some classes in wildmagic4 engine. I have used devil(a open library for images) for create gl textures from .jpg images. The problem is that i have included some devil library in a project library(libgraphics), and modified some classes inherited from Image, and when i include in an application project the libgraphics.lib generated with devil i catch these errors: this is the crucial class:
#include "Wm4GraphicsPCH.h"
#include "ImageEx.h"
#include <string>
#include "il/Il.h"
#include "il/Ilu.h"
ImageEx::ImageEx(void)
{
}

ImageEx::~ImageEx(void)
{
}

ImageEx* ImageEx::Load(const std::string& rkImageName, bool bAbsolutePath)
{
	
	ilInit();
	ILuint imageID = -1;
	ILboolean imageLoaded;

	/*GLuint width;
	GLuint height;
	GLuint bpp;
	GLuint format;*/

	ilGenImages( 1, &imageID );

	
	imageLoaded = ilLoadImage( rkImageName.c_str() );

	if ( !imageLoaded )
	{
		ilDeleteImages( 1, &imageID );
		return false;
	}
	else
	{
		imageLoaded = ilConvertImage( IL_RGBA, IL_UNSIGNED_BYTE );

		if ( !imageLoaded )
		{
			ilDeleteImages( 1, &imageID );
			return false;
		}

		ILint width = ilGetInteger( IL_IMAGE_WIDTH );
		ILint height = ilGetInteger( IL_IMAGE_HEIGHT );
		ILint bpp = ilGetInteger( IL_IMAGE_BPP );
		ILint format = ilGetInteger( IL_IMAGE_FORMAT );

		int IMGWidth, IMGHeight;

		IMGWidth = (int)width;
		IMGHeight = (int)height;
		m_aucData = (unsigned char*) ilGetData();
	}
	return this;
}

and the header:
#include "wm4image.h"
#include "il/il.h"
#include <string>
class ImageEx : Wm4::Image
{
public:
	ImageEx(void);
	~ImageEx(void);
	ImageEx* Load (const std::string& rkImageName, bool bAbsolutePath);
};

#include "ImageEx.inl"



and this is the application file:


// test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "imageex.h"
using namespace Wm4;

int _tmain(int argc, _TCHAR* argv[])
{
	//iluInit();
	ImageEx* im = new ImageEx();
	return 0;
}


this is the error: Error 3 error LNK2019: unresolved external symbol __imp__ilConvertImage@8 referenced in function "public: class ImageEx * __thiscall ImageEx::Load(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?Load@ImageEx@@QAEPAV1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) imageex.obj thanks.

Share this post


Link to post
Share on other sites
EDIT: Disregard. I'm an idiot. You're getting a linker error.

Just a quick look-

Try adding

using namespace Wm4;

to your class file?

Or Wm4::ilConvertImage(...)?

[Edited by - Buckeye on February 21, 2010 1:03:33 PM]

Share this post


Link to post
Share on other sites
Is that the only linker error you are getting?

Are you linking to DevIL as well as your libgraphics.lib in your application?

Share this post


Link to post
Share on other sites
no , i have 7 unresolved externals error,
one for each IL(of devil)function that i have used in imagex.cpp .
why?????

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this