Page 1 of 1

Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Wed Jan 27, 2016 2:29 pm
by niubaty
It first failed in objconv/mesher/to_OgreMesh.cpp, and solved by the instruction of http://forums.vega-strike.org/viewtopic.php?f=5&t=20267

and then a new fail...

Code: Select all

Linking CXX executable mesh_tool
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::Init()’中:
to_OgreMesh.cpp:(.text+0x903):undefined references to 'vtable for Ogre::MeshPtr'
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::Init(char const*, char const*)’中:
to_OgreMesh.cpp:(.text+0xfa1):undefined references to 'vtable for Ogre::MeshPtr'
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::Optimize(void*)’中:
to_OgreMesh.cpp:(.text+0x1b06):undefined references to 'vtable for Ogre::MeshPtr'
to_OgreMesh.cpp:(.text+0x1b45):undefined references to 'vtable for Ogre::MeshPtr'
to_OgreMesh.cpp:(.text+0x1c00):undefined references to 'vtable for Ogre::MeshPtr'
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:to_OgreMesh.cpp:(.text+0x1e16): more undefined references to `vtable for Ogre::MeshPtr' follow
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::AutoLOD(void*, bool, int, float, float)’中:
to_OgreMesh.cpp:(.text+0x1fca):对‘Ogre::ProgressiveMesh::generateLodLevels(Ogre::Mesh*, std::vector<float, Ogre::STLAllocator<float, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > const&, Ogre::ProgressiveMesh::VertexReductionQuota, float)' undefined reference
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::DoneMeshes(void*)’中:
to_OgreMesh.cpp:(.text+0x26c9):undefined references to 'vtable for Ogre::MeshPtr'
CMakeFiles/mesh_tool.dir/mesher/to_OgreMesh.o:在函数‘OgreMeshConverter::AddMesh(void*, XML const&, std::string const&, bool, bool) [clone .constprop.390]’中:
to_OgreMesh.cpp:(.text+0x2bb6):undefined references to 'vtable for Ogre::MeshPtr'
collect2: error: ld returned 1 exit status
make[2]: *** [objconv/mesh_tool] 错误 1
make[1]: *** [objconv/CMakeFiles/mesh_tool.dir/all] 错误 2
make: *** [all] 错误 2
how to solve this?

Re: Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Wed Jan 27, 2016 4:34 pm
by loki1950
The failed compile is for mesher which is a command line utility for creating ships with our custom mesh format it is not needed if you just want to play the game.

Enjoy the Choice :)

Re: Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Fri Jan 29, 2016 4:30 pm
by niubaty
loki1950 wrote:The failed compile is for mesher which is a command line utility for creating ships with our custom mesh format it is not needed if you just want to play the game.
The utility for creating ships is cool, what should I do if I want to compile it?
:)

And I remove the follow content in CMakeLists.txt

Code: Select all

find_package(OGRE)
IF(OGRE_FOUND)
    SET(TST_INCLUDES ${TST_INCLUDES} ${OGRE_INCLUDE_DIR})
    SET(TST_LIBS ${TST_LIBS} ${OGRE_LIBRARY})
    add_definitions(${OGRE_DEFINITIONS})
    SET(HAVE_OGRE 1)
    message("++ Found Ogre: ${OGRE_VERSION}")
ELSE(OGRE_FOUND)
    message("-- Ogre Not Found: compiling without")
ENDIF(OGRE_FOUND)
remake it, but it stops at about 71% with the following error.

Code: Select all

/home/clicknight/vegastrike-src-0.5.1.r1/src/resizable.h:19:43: error: ‘memcpy’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         memcpy( q, c.q, sizeof (ITEM)*num );
                                           ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from /home/clicknight/vegastrike-src-0.5.1.r1/src/gfx/quadsquare.cpp:12:
/usr/include/x86_64-linux-gnu/bits/string3.h:48:1: note: ‘void* memcpy(void*, const void*, size_t)’ declared here, later in the translation unit
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
make[2]: *** [CMakeFiles/vegastrike.dir/src/gfx/quadsquare.o] error 1
make[1]: *** [CMakeFiles/vegastrike.dir/all] error 2
make: *** [all] error 2
Now what should I do to go on?

Re: Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Sat Jan 30, 2016 9:57 am
by niubaty
To the "memcpy" problem:
Adding "include <string.h>" to the head of the cpp file.
and I also remove the ffmpeg part of the CMakeLists.txt as follow.

Code: Select all

#find_package(FFMPEG)
#IF(FFMPEG_FOUND)
#	SET(TST_INCLUDES ${TST_INCLUDES} ${FFMPEG_INCLUDE_DIRS})
#	SET(TST_LIBS ${TST_LIBS} ${FFMPEG_LIBRARIES})
#	add_definitions(${FFMPEG_DEFINITIONS})
#	SET(HAVE_FFMPEG 1 )
#	IF(swscale1_FOUND)
#        message("++ FFmpeg's libswscale found.")
#	ELSE(swscale1_FOUND)
#        message("-- FFMpeg's libswscale not found... depending on your ffmpeg version, VS might not build.")
#	ENDIF(swscale1_FOUND)
#ELSE(FFMPEG_FOUND)
#	message("-- FFMPEG Not Found")
#ENDIF(FFMPEG_FOUND)
but a new fail occurs.

Code: Select all

/home/clicknight/vegastrike-src-0.5.1.r1/src/cmd/unit.cpp:726:16:   required from here
/home/clicknight/vegastrike-src-0.5.1.r1/src/cmd/unit_jump.h:111:153: error: ‘SetCurPosition’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
                             SetCurPosition( this->LocalPosition()+this->cumulative_transformation_matrix.getR()*( 4*( this->rSize()+tester->rSize() ) ) );
                                                                                                                                                         ^
/home/clicknight/vegastrike-src-0.5.1.r1/src/cmd/unit_jump.h:111:153: note: declarations in dependent base ‘Unit’ are not found by unqualified lookup
/home/clicknight/vegastrike-src-0.5.1.r1/src/cmd/unit_jump.h:111:153: note: use ‘this->SetCurPosition’ instead
How to go on

Re: Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Sat Jan 30, 2016 5:53 pm
by niubaty
as it says:
use 'this->SetCurPosition' instead 'SetCurPosition'

and remake.
this problem will be solved

Re: Unable to complie vegastrike-src-0.5.1.r1 in Ubuntu14.04

Posted: Sat Jan 30, 2016 5:58 pm
by niubaty
The game finally runs good, thanks.