unable to build application with ogre1.8.2 (STATIC)

Problems building or running the engine, queries about how to use features etc.
Post Reply
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

unable to build application with ogre1.8.2 (STATIC)

Post by shome »

i have installed ogre 1.8.2 on ubuntu 14.04.
i ran all OGRE samples successfully from /opt/OGRE/lib

when i try to build an application hand_cpp([libhand][https://github.com/jsupancic/libhand-public]), i get error:
Scanning dependencies of target pose_designer
[100%] [100%] Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer.cc.o
Building CXX object source/CMakeFiles/pose_designer.dir/pose_designer_main.cc.o
Linking CXX executable pose_designer
libhand_utils.a(file_dialog.cc.o): In function `libhand::FileDialog::TkExec(std::string const&)':
/home/krr/shome/libhand/libhand-public-master/hand_cpp_ogre_v1.8/source/file_dialog.cc:91: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'

/opt/OGRE/lib/libOgreMainStatic.a(OgreConfigDialog.cpp.o): In function `Ogre::GLXConfigurator::SetRenderer(Ogre::RenderSystem*)':
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:445: undefined reference to `labelWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:458: undefined reference to `menuButtonWidgetClass'
libhand/libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:462: undefined reference to `simpleMenuWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:473: undefined reference to `smeBSBObjectClass'

/opt/OGRE/lib/libOgreMainStatic.a(OgreConfigDialog.cpp.o): In function `Ogre::GLXConfigurator::CreateWindow()':
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:255: undefined reference to `formWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:270: undefined reference to `labelWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:286: undefined reference to `menuButtonWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:289: undefined reference to `simpleMenuWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:299: undefined reference to `smeBSBObjectClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:313: undefined reference to `formWidgetClass'
libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/GLX/OgreConfigDialog.cpp:315: undefined reference to `commandWidgetClass'
collect2: error: ld returned 1 exit status
make[2]: *** [source/pose_designer] Error 1

what library am i missing? i think it is X11. i tried adding -ldl -lXt -lX11 to target link libs.( i have X11 at /usr/lib/x86_64-linux-gnu/libX11.so). but adding lX11 didnt work.
can anyone help?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: unable to build application with ogre1.8.2 (STATIC)

Post by Transporter »

You should update your project to OGRE 1.10.
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

Re: unable to build application with ogre1.8.2 (STATIC)

Post by shome »

you mean ogre 2.1 ?

no i cant upgrade, as I am using someone elses code and it was developed on OGRE-1.7.3 . i am trying ogre 1.8 as the mesh format has been upgraded since 1.8 and i have to use the new mesh format after 1.8
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: unable to build application with ogre1.8.2 (STATIC)

Post by c6burns »

Why did that guy update the meshes in his fork to 1.8 version? Aren't they just the exact same meshes from everyone else's libhand fork? Just use the ones from someone's fork who didn't update them if so.

PS - The missing library is Xaw
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

Re: unable to build application with ogre1.8.2 (STATIC)

Post by shome »

@c6burns: You are the really the BEHOLDER.
It worked finally.
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: unable to build application with ogre1.8.2 (STATIC)

Post by c6burns »

Sweet man, I want your damn libhand to finally work hahaha
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

Re: unable to build application with ogre1.8.2 (STATIC)

Post by shome »

OOPs error again.
The code built ok. when i run the executable, it asks for a scene_spec.yml through a GUI.
when i load the scene_spec.yml,
I get 1 error and one warning:

Error loading texture hand_texture.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(5:ItemIdentityException): Can not find codec for 'png' image format.
There are no formats supported (no codecs registered). in Codec::getCodec at libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/OgreCodec.cpp (line 69)
Finished loading resource group 0HandRenderer Scene Resources
[DotSceneLoader] Parsing dotScene file with version 1.0.1
Mesh: Loading hand_arm.mesh.
Skeleton: Loading hand.skeleton
mesh file = hand_arm.mesh
WARNING: the mesh 'hand_arm.mesh' includes vertices with more than 4 bone assignments. The lowest weighted assignments beyond this limit have been removed, so your animation may look slightly different. To eliminate this, reduce the number of bone assignments per vertex on your mesh to 4.
Set material skin for hand
[DotSceneLoader] Error loading an entity because OGRE EXCEPTION(2:InvalidParametersException): Index out of bounds. in Mesh::getSubMesh at libhand-public-master/install_help/linux_ogre_static_installer/ogre_v1-8/OgreMain/src/OgreMesh.cpp (line 240)
no camera :-(
User avatar
c6burns
Beholder
Posts: 1512
Joined: Fri Feb 22, 2013 4:44 am
Location: Deep behind enemy lines
x 138

Re: unable to build application with ogre1.8.2 (STATIC)

Post by c6burns »

Problem #1 is that at the time you configured Ogre with CMake it didn't find freeimage. So you have no png support

Problem #2 is with whatever mesh the DotSceneLoader happens to be trying to load. You could run it through gdb and catch throw so it breaks on exceptions and see wtf is going on

The warning about bone vertex weighting isn't causing you a problem as far as we know. If the hand animates strangely once everything else works, then you can look there for issues, but it's nothing that will stop the application from running.

Sorry I'm avoiding building this library myself like the plague, because I don't entirely trust this fork you are using and I have a lot of my own work right now
shome
Halfling
Posts: 76
Joined: Thu Jan 28, 2016 6:49 am
x 1

Re: unable to build application with ogre1.8.2 (STATIC)

Post by shome »

I get the following while running the application:

DDS codec registering
FreeImage version: 3.15.4
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti

Doesnt ite mean that ogre is detecting freeimage? i have libpng12 installed, but not libpng3. is libpng3 needed?
I also checked ogre cmakecache.txt for freeimage:

FreeImage_INCLUDE_DIR:PATH=/usr/include
FreeImage_LIBRARY_DBG:FILEPATH=/usr/lib/libfreeimage.so
FreeImage_LIBRARY_REL:FILEPATH=/usr/lib/libfreeimage.so
OGRE_CONFIG_ENABLE_FREEIMAGE:BOOL=ON
OgreMain_LIB_DEPENDS:STATIC=optimized;/usr/local/lib/libfreetype.so;debug;/usr/local/lib/libfreetype.so;general;/usr/lib/x86_64-linux-gnu/libSM.so;general;/usr/lib/x86_64-linux-gnu/libICE.so;general;/usr/lib/x86_64-linux-gnu/libX11.so;general;/usr/lib/x86_64-linux-gnu/libXext.so;general;/usr/lib/x86_64-linux-gnu/libXt.so;general;/usr/lib/x86_64-linux-gnu/libXaw.so;general;pthread;general;dl;optimized;/usr/lib/libtbb.so;debug;/usr/lib/libtbb.so;optimized;/usr/lib/libfreeimage.so;debug;/usr/lib/libfreeimage.so;optimized;/usr/lib/x86_64-linux-gnu/libzzip.so;debug;/usr/lib/x86_64-linux-gnu/libzzip.so;optimized;/usr/lib/x86_64-linux-gnu/libz.so;debug;/usr/lib/x86_64-linux-gnu/libz.so;
FreeImage_INCLUDE_DIR-ADVANCED:INTERNAL=1
FreeImage_LIBRARY_DBG-ADVANCED:INTERNAL=1
FreeImage_LIBRARY_REL-ADVANCED:INTERNAL=1
OGRE_CONFIG_ENABLE_FREEIMAGE-ADVANCED:INTERNAL=1
__pkg_config_checked_FreeImage_PKGC:INTERNAL=1
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: unable to build application with ogre1.8.2 (STATIC)

Post by Transporter »

It looks like FreeImage is used by Ogre. FreeImage contains libpng, so normally it should work. If you have a modified fork, maybe there is a bug in source code. I still recommend you to upgrade your code to OGRE 1.10+.
Post Reply