SVL (simple vector library) http://www.cs.cmu.edu/~ajw/doc/svl.html
and FLTK ... has linking problem.  Please help!!

I used the "shape.cxx" in test directory.

include <svl/svl.h>;
in main():
test the matrix functions: initiate a matrix and compute its trace.

Mat2 is OK, Mat3 and Mat4 seems to have problems.

Any pointer greatly appreciated.

I use FLTK 1.1.10rc, SVL-1.5, VC6.0
===================================
// source code (shape.cxx)
#include "config.h"
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Hor_Slider.H>
#include <FL/math.h>

#include <svl/svl.h>

#if HAVE_GL

#include <FL/gl.h>
#include <FL/Fl_Gl_Window.H>

class shape_window : public Fl_Gl_Window {
  void draw();
public:
  int sides;
  shape_window(int x,int y,int w,int h,const char *l=0);
};

shape_window::shape_window(int x,int y,int w,int h,const char *l) :
Fl_Gl_Window(x,y,w,h,l) {
  sides = 3;
}

void shape_window::draw() {
// the valid() property may be used to avoid reinitializing your
// GL transformation for each redraw:
  if (!valid()) {
    valid(1);
    glLoadIdentity();
    glViewport(0, 0, w(), h());
  }
// draw an amazing graphic:
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(.5,.6,.7);
  glBegin(GL_POLYGON);
  for (int j=0; j<sides; j++) {
    double ang = j*2*M_PI/sides;
    glVertex3f(cos(ang),sin(ang),0);
  }
  glEnd();
}

#else

#include <FL/Fl_Box.H>
class shape_window : public Fl_Box {
public:
  int sides;
  shape_window(int x,int y,int w,int h,const char *l=0)
    :Fl_Box(FL_DOWN_BOX,x,y,w,h,l){
      label("This demo does\nnot work without GL");
  }
};

#endif

// when you change the data, as in this callback, you must call redraw():
void sides_cb(Fl_Widget *o, void *p) {
  shape_window *sw = (shape_window *)p;
  sw->sides = int(((Fl_Slider *)o)->value());
  sw->redraw();
}

int main(int argc, char **argv) {
Mat2 m2; trace(m2);
        Mat3 m3; trace(m3);
Mat4 m4; trace(m4);

  Fl_Window window(300, 330);

// the shape window could be it's own window, but here we make it
// a child window:
  shape_window sw(10, 10, 280, 280);
// make it resize:
  window.resizable(&sw);
  //  window.size_range(300,330,0,0,1,1,1);
// add a knob to control it:
  Fl_Hor_Slider slider(50, 295, window.w()-60, 30, "Sides:");
  slider.align(FL_ALIGN_LEFT);
  slider.callback(sides_cb,&sw);
  slider.value(sw.sides);
  slider.step(1);
  slider.bounds(3,40);

  window.end();
  window.show(argc,argv);

  return Fl::run();
}

//
// End of "$Id: shape.cxx 5845 2007-05-20 00:01:06Z mike $".
//

===linker error ==========
--------------------Configuration: shape - Win32 Debug--------------------
Linking...
libcpd.lib(iostream.obj) : error LNK2005: "public: __thiscall 
std::ios_base::Init::Init(void)" (??0i...@ios_base@std@@q...@xz) already 
defined in msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(iostream.obj) : error LNK2005: "public: __thiscall 
std::ios_base::Init::~Init(void)" (??1i...@ios_base@std@@q...@xz) already 
defined in msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(locale.obj) : error LNK2005: "public: __thiscall 
std::_Locinfo::_Locinfo(char const *)" (??0_loci...@std@@q...@pbd@Z) already 
defined in msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(locale.obj) : error LNK2005: "public: __thiscall 
std::_Locinfo::~_Locinfo(void)" (??1_loci...@std@@q...@xz) already defined in 
msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(locale0.obj) : error LNK2005: "public: class std::locale::facet 
const * __thiscall std::locale::_Getfacet(unsigned int,bool)const " 
(?_getfa...@locale@std@@qbepbvfa...@12@i...@z) already defined in 
msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(locale0.obj) : error LNK2005: "public: bool __thiscall 
std::locale::_Iscloc(void)const " (?_isc...@locale@std@@QBE_NXZ) already 
defined in msvcprtd.lib(MSVCP60D.dll)
libcpd.lib(ios.obj) : error LNK2005: "public: void __thiscall 
std::ios_base::clear(int,bool)" (?cl...@ios_base@std@@qaex...@z) already 
defined in msvcprtd.lib(MSVCP60D.dll)
svl-dbg.lib(LibSVL.obj) : error LNK2001: unresolved external symbol __HUGE
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol _errno
svl-dbg.lib(LibSVL.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(locale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _errno
libcpd.lib(wlocale.obj) : error LNK2001: unresolved external symbol 
___mb_cur_max
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol 
___mb_cur_max
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol 
___mb_cur_max
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol 
___lc_codepage
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol 
___lc_codepage
libcpd.lib(xwctomb.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol ___lc_handle
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol 
___lc_handle
libcpd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol __pctype
libcpd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol 
___lc_collate_cp
./test/shaped.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

shaped.exe - 26 error(s), 0 warning(s)

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to