Compiling with Cimage use failed with link error.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
wanliqun
Posts: 26
Joined: Sun Nov 20, 2011 2:23 pm

Compiling with Cimage use failed with link error.

Post by wanliqun »

I'm trying to make some use of CImage with jirr. Here is the generated code by swig for this:

Code: Select all

 
SWIGEXPORT void JNICALL Java_net_sf_jirr_JirrJNI_CImage_1drawLine(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jlong jarg3, jobject jarg3_, jlong jarg4, jobject jarg4_) {
  irr::video::CImage *arg1 = (irr::video::CImage *) 0 ;
  irr::core::vector2d< irr::s32 > *arg2 = 0 ;
  irr::core::vector2d< irr::s32 > *arg3 = 0 ;
  irr::video::SColor *arg4 = 0 ;
  
  (void)jenv;
  (void)jcls;
  (void)jarg1_;
  (void)jarg2_;
  (void)jarg3_;
  (void)jarg4_;
  arg1 = *(irr::video::CImage **)&jarg1; 
  arg2 = *(irr::core::vector2d< irr::s32 > **)&jarg2;
  if (!arg2) {
    SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "irr::core::vector2d< irr::s32 > const & reference is null");
    return ;
  } 
  arg3 = *(irr::core::vector2d< irr::s32 > **)&jarg3;
  if (!arg3) {
    SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "irr::core::vector2d< irr::s32 > const & reference is null");
    return ;
  } 
  arg4 = *(irr::video::SColor **)&jarg4;
  if (!arg4) {
    SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "irr::video::SColor const & reference is null");
    return ;
  } 
  (arg1)->drawLine((irr::core::vector2d< irr::s32 > const &)*arg2,(irr::core::vector2d< irr::s32 > const &)*arg3,(irr::video::SColor const &)*arg4);
}
 
Unfortunately I got a link error as follows:
1>jirr_wrap.obj : error LNK2019: unresolved external symbol "public: void __thiscall irr::video::CImage::drawLine(class irr::core::vector2d<int> const &,class irr::core::vector2d<int> const &,class irr::video::SColor const &)" (?drawLine@CImage@video@irr@@QAEXABV?$vector2d@H@core@3@0ABVSColor@23@@Z) referenced in function _Java_net_sf_jirr_JirrJNI_CImage_1drawLine@561
What confused me more is that the interfaces of the other classes seem to be all right after commenting

Code: Select all

(arg1)->drawLine((irr::core::vector2d< irr::s32 > const &)*arg2,(irr::core::vector2d< irr::s32 > const &)*arg3,(irr::video::SColor const &)*arg4);

I've double-checked my irrlicht lib & dll project, and make sure that Cimage.cpp is added to the project. I'm using VC++2008, on windows XP, any clue on this?
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: Compiling with Cimage use failed with link error.

Post by gerdb »

hi,

CImage is not public in <irrlicht.h>, but IImage is ( regardless if linking with lib or dll )

maybe do a include statement like

#include <irrlicht.h>
#include <../source/Irrlicht/CImage.h>

if the first works, the second will too
wanliqun
Posts: 26
Joined: Sun Nov 20, 2011 2:23 pm

Re: Compiling with Cimage use failed with link error.

Post by wanliqun »

Hi, gerdb, I'm pretty sure I've add the cimage.h into the include path and #included into my project. There is some interface like drawRectangle, drawLines is not defined in IImage interface. I'm using irrlich 1.7.2, maybe I need to compare my current version with the latest svn release.
Post Reply