ARToolKit | Mailing List Archive |
![]() |
From: | joele.d@p ........ | Received: | Sep 22, 2005 |
To | artoolkit@h .................. | ||
Subject: | ARToolkit as C++ files? | ||
Hello everybody=2C i=B4m using ARToolkit twoView example=2E I have modified some pieces of i= t = and I can compile and run it=2E Now I want to use the GLUI library for = having a graphical user interface=2E Only the problem is that GLUI can = only be linked against C++ files=2E Because the twoView example uses C files=2C I tried to change their = extension to =2Ecpp=2E Then=2C when I try to compile I get some errors=2E I suppose it=B4s an ea= sy = thing to fix=2C but I haven=B4t figured out yet how=2E Anybody has some i= dea=3F Before there was not any problem=2E Must be some kind of incompatibility = between chars in C and C++=2E Could that be=3F It goes wrong on the following lines=3A const unsigned char *cparam=5Fnames=5B=5D =3D =7B = =22Data/ter=2Edat=22=2C =22Data/camera=5Fpara=2Edat=22=2C = =7D=3B const unsigned char *patt=5Fname =3D =22Data/patt=2Ehiro=22=3B if (arParamLoad(cparam=5Fnames=5Bi=5D=2C 1=2C =26wparam) =3C 0) if((*patt=5Fid =3D arLoadPatt(patt=5Fname)) =3C 0) This is what I get=3A c=3A=5Cdocuments and = settings=5Cdennis=5Cescritorio=5Cartoolkit=5Cexamples=5Ctwoview=5Ctwoview= =2Ecpp(68) =3A = error C2440=3A =27initializing=27 =3A cannot convert from =27char =5B13=5D= =27 to =27const = unsigned char *=27 Types pointed to are unrelated=3B conversion requires = reinterpret=5Fcast=2C C-style cast or function-style cast c=3A=5Cdocuments and = settings=5Cdennis=5Cescritorio=5Cartoolkit=5Cexamples=5Ctwoview=5Ctwoview= =2Ecpp(69) =3A = error C2440=3A =27initializing=27 =3A cannot convert from =27char =5B21=5D= =27 to =27const = unsigned char *=27 Types pointed to are unrelated=3B conversion requires = reinterpret=5Fcast=2C C-style cast or function-style cast c=3A=5Cdocuments and = settings=5Cdennis=5Cescritorio=5Cartoolkit=5Cexamples=5Ctwoview=5Ctwoview= =2Ecpp(99) =3A = error C2440=3A =27initializing=27 =3A cannot convert from =27char =5B15=5D= =27 to =27const = unsigned char *=27 Types pointed to are unrelated=3B conversion requires = reinterpret=5Fcast=2C C-style cast or function-style cast draw=2Ecpp graphic=2Ecpp init=2Ecpp c=3A=5Cdocuments and = settings=5Cdennis=5Cescritorio=5Cartoolkit=5Cexamples=5Ctwoview=5Cinit=2E= cpp(26) =3A = error C2664=3A =27arParamLoad=27 =3A cannot convert parameter 1 from =27c= onst = unsigned char *=27 to =27const char *=27 Types pointed to are unrelated=3B conversion requires = reinterpret=5Fcast=2C C-style cast or function-style cast c=3A=5Cdocuments and = settings=5Cdennis=5Cescritorio=5Cartoolkit=5Cexamples=5Ctwoview=5Cinit=2E= cpp(48) =3A = error C2664=3A =27arLoadPatt=27 =3A cannot convert parameter 1 from =27co= nst = unsigned char *=27 to =27const char *=27 Types pointed to are unrelated=3B conversion requires = reinterpret=5Fcast=2C C-style cast or function-style cast |
From: | Daniel Wagner <daniel@i ...............> | Received: | Sep 22, 2005 |
To | artoolkit@h .................. | ||
Subject: | Re: ARToolkit as C++ files? | ||
joele.d@p ........ wrote: >Only the problem is that GLUI can only be linked against C++ files. > > i seriously doubt that this is true... Daniel |
From: | "Daron Anderson" <daronanderson@e ............> | Received: | Sep 24, 2005 |
To | <joele.d@p ........>, <artoolkit@h ..................> | ||
Subject: | Re: ARToolkit as C++ files? | ||
If you compile the twoView example files with the .C extension, what errors do you encounter? Can you help us understand why the GLUI library fails to be linked to these files? ----- Original Message ----- From: <joele.d@p ........> To: <artoolkit@h ..................> Sent: Thursday, September 22, 2005 8:14 AM Subject: ARToolkit as C++ files? Hello everybody, iīm using ARToolkit twoView example. I have modified some pieces of it and I can compile and run it. Now I want to use the GLUI library for having a graphical user interface. Only the problem is that GLUI can only be linked against C++ files. Because the twoView example uses C files, I tried to change their extension to .cpp. Then, when I try to compile I get some errors. I suppose itīs an easy thing to fix, but I havenīt figured out yet how. Anybody has some idea? Before there was not any problem. Must be some kind of incompatibility between chars in C and C++. Could that be? It goes wrong on the following lines: const unsigned char *cparam_names[] = { "Data/ter.dat", "Data/camera_para.dat", }; const unsigned char *patt_name = "Data/patt.hiro"; if (arParamLoad(cparam_names[i], 1, &wparam) < 0) if((*patt_id = arLoadPatt(patt_name)) < 0) This is what I get: c:\documents and settings\dennis\escritorio\artoolkit\examples\twoview\twoview.cpp(68) : error C2440: 'initializing' : cannot convert from 'char [13]' to 'const unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\dennis\escritorio\artoolkit\examples\twoview\twoview.cpp(69) : error C2440: 'initializing' : cannot convert from 'char [21]' to 'const unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\dennis\escritorio\artoolkit\examples\twoview\twoview.cpp(99) : error C2440: 'initializing' : cannot convert from 'char [15]' to 'const unsigned char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast draw.cpp graphic.cpp init.cpp c:\documents and settings\dennis\escritorio\artoolkit\examples\twoview\init.cpp(26) : error C2664: 'arParamLoad' : cannot convert parameter 1 from 'const unsigned char *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast c:\documents and settings\dennis\escritorio\artoolkit\examples\twoview\init.cpp(48) : error C2664: 'arLoadPatt' : cannot convert parameter 1 from 'const unsigned char *' to 'const char *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast |