il fatto è che ho compilato una libreria (.lib) con delle dipendenze (alla fine della compilazione mi si crea un .lib).
Ho incluso in un altro progetto questa libreria , ma ottengo questi errori:
1>Linking...
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilGetData@0 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilGetInteger@4 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilDeleteImages@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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilLoadImage@4 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilGenImages@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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilutInit@0 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__iluInit@0 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)
1>Wm4Graphics90d.lib(ImageEx.obj) : error LNK2019: unresolved external symbol __imp__ilInit@0 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)
1>C:\programmazione\wild magic 4\GeometricTools\WildMagic4\Builds\Builds\Debug\te st.exe : fatal error LNK1120: 9 unresolved externals
1>Build log was saved at "file://c:\programmazione\wild magic 4\GeometricTools\WildMagic4\Builds\Builds\test\Deb ug\BuildLog.htm"
1>test - 10 error(s), 0 warning(s)
questo è imageex.h:
codice:
#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);
};
e questo è il .cpp
codice:
#include "Wm4GraphicsPCH.h"
#include "ImageEx.h"
#include <string>
#include "il/Il.h"
ImageEx::ImageEx(void)
{
}
ImageEx::~ImageEx(void)
{
}
ImageEx* ImageEx::Load(const std::string& rkImageName, bool bAbsolutePath)
{
ilInit();
iluInit();
ilutInit();
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;
}
width = ilGetInteger( IL_IMAGE_WIDTH );
height = ilGetInteger( IL_IMAGE_HEIGHT );
bpp = ilGetInteger( IL_IMAGE_BPP );
format = ilGetInteger( IL_IMAGE_FORMAT );
int IMGWidth, IMGHeight;
IMGWidth = (int)width;
IMGHeight = (int)height;
m_aucData = (unsigned char*) ilGetData();
}
return this;
}
tutte le chiamate a funzioni danno un link error , mentre i tipi no.
Ribadisco che questo compila e genera la libreria, solo se la inserisco in un altro progetto e compilo ho gli errori di sopra .
Questo è l'altro progetto:
codice:
#include "stdafx.h"
#include "IL/Il.h"
#include "imageex.h"
using namespace Wm4;
int _tmain(int argc, _TCHAR* argv[])
{
ImageEx* im = new ImageEx();
return 0;
}