BlindMindStudios / StarRuler2-Source

4X Space Strategy game Star Ruler 2's open source distribution.
http://starruler2.com
Other
1.45k stars 244 forks source link

Ubuntu 18.04 x64 can't compile #24

Open zor1984qq opened 5 years ago

zor1984qq commented 5 years ago

ccache make -f source/linux/Makefile compile then it gives thousands of same type errors

I managed to install all deps, using libcurl4-openssl-dev I don't think these can be an issue but maybe it needs just libcurl-openssl1.0-dev package instead of new openssl? But it just my thoughts.

Using gcc-7/bionic,now 7.3.0-16ubuntu3 amd64 [installed, auto] Should I use an older version or the builds is only availible in MSVC studio?

:(.text+0x1c796): undefined reference to `operator delete(void*)' :(.text+0x1c7d7): undefined reference to `operator delete(void*)' :(.text+0x1c818): undefined reference to `operator delete(void*)' :(.text+0x1c859): undefined reference to `operator delete(void*)' :(.text+0x1c89a): undefined reference to `operator delete(void*)' /tmp/ccaEI5CM.ltrans7.ltrans.o::(.text+0x1c931): more undefined references to `operator delete(void*)' follow /tmp/ccaEI5CM.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1aec): undefined reference to `pthread_create' /tmp/ccaEI5CM.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1b36): undefined reference to `pthread_create' /tmp/ccaEI5CM.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1b8b): undefined reference to `pthread_create' /tmp/ccaEI5CM.ltrans7.ltrans.o: In function `std::vector >::~vector() [clone .lto_priv.1954]': :(.text+0x9666): undefined reference to `operator delete(void*)' :(.text+0x9689): undefined reference to `operator delete(void*)' /tmp/ccaEI5CM.ltrans7.ltrans.o: In function `std::vector >::~vector() [clone .lto_priv.2298]': :(.text+0x9749): undefined reference to `operator delete(void*)' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x18): undefined reference to `vtable for __cxxabiv1::__si_class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x30): undefined reference to `vtable for __cxxabiv1::__si_class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x48): undefined reference to `vtable for __cxxabiv1::__function_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x58): undefined reference to `vtable for __cxxabiv1::__function_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x68): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x78): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x88): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x98): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0xa8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0xb8): more undefined references to `vtable for __cxxabiv1::__class_type_info' follow /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0xf8): undefined reference to `vtable for __cxxabiv1::__pointer_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x118): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x128): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x138): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x148): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x158): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x168): more undefined references to `vtable for __cxxabiv1::__class_type_info' follow /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x288): undefined reference to `vtable for __cxxabiv1::__pointer_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2a8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2b8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2c8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2d8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2e8): undefined reference to `vtable for __cxxabiv1::__class_type_info' /tmp/ccaEI5CM.ltrans7.ltrans.o:(.data.rel.ro+0x2f8): more undefined references to `vtable for __cxxabiv1::__class_type_info' follow collect2: error: ld returned 1 exit status source/linux/Makefile:322: recipe for target 'bin/lin64/StarRuler2.bin' failed make: *** [bin/lin64/StarRuler2.bin] Error 1
aanderse commented 5 years ago

I am able to reproduce this issue on Ubuntu 18.04.

Reviewing the makefile my assumption is that CC is already set to gcc instead of g++ and this is causing the issue. By temporarily setting the CC environment variable to g++ before running the command I was able to fix the specific errors you are seeing:

CC=g++ make -f source/linux/Makefile compile

Note I have a new set of errors, though. Here is list representative of some of those errors:

/tmp/cc2TUe1c.ltrans0.ltrans.o: In function `Design::save(SaveFile&) const':

:(.text+0x21ae3): undefined reference to `gzwrite' /tmp/cc2TUe1c.ltrans0.ltrans.o: In function `Design::Design(SaveFile&)': :(.text+0x24b6b): undefined reference to `gzread' /tmp/cc2TUe1c.ltrans3.ltrans.o: In function `std::_Function_handler, std::allocator >, std::allocator, std::allocator > > > const&)::{lambda()#36}>::_M_invoke(std::_Any_data const&) [clone .lto_priv.3041]': :(.text+0x71d8): undefined reference to `pthread_create' /tmp/cc2TUe1c.ltrans3.ltrans.o: In function `std::_Function_handler, std::allocator >, std::allocator, std::allocator > > >&), Console::Console()::{lambda(std::vector, std::allocator >, std::allocator, std::allocator > > >&)#3}>::_M_invoke(std::_Any_data const&, std::vector, std::allocator >, std::allocator, std::allocator > > >&) [clone .lto_priv.1959]': :(.text+0x88bc): undefined reference to `XFlush' /tmp/cc2TUe1c.ltrans6.ltrans.o: In function `scene::MeshIconNode::render(render::RenderDriver&)': :(.text+0x94d0): undefined reference to `glPushMatrix' /tmp/cc2TUe1c.ltrans8.ltrans.o: In function `render::GLShader::loadDynamicVars(float*) const': :(.text+0x3eb7): undefined reference to `__glewUniform4iv' /tmp/cc2TUe1c.ltrans8.ltrans.o: In function `render::FontFT2::~FontFT2()': :(.text+0xa24c): undefined reference to `FT_Done_Size' /tmp/cc2TUe1c.ltrans10.ltrans.o: In function `scripts::CurlThread(void*)': :(.text+0x10174): undefined reference to `curl_easy_perform' /tmp/cc2TUe1c.ltrans20.ltrans.o: In function `audio::CSoundSource::setDefaultSettings(unsigned int) const': :(.text+0x16e0): undefined reference to `alSourcef' /tmp/cc2TUe1c.ltrans28.ltrans.o: In function `audio::CSSOgg::CSSOgg(_IO_FILE*, audio::ISoundDevice*, bool) [clone .constprop.29]': :(.text+0x4703): undefined reference to `ov_clear' /tmp/cc2TUe1c.ltrans28.ltrans.o: In function `savePNG(Image const*, char const*, bool)': :(.text+0xa5c6): undefined reference to `png_create_write_struct' It looks like at some point in the makefile the dependencies for building this game aren't being linked in.
kmcnayr commented 5 years ago

I followed the tips that @compenguy suggested in issue #5 and was able to successfully compile and run on Ubuntu 17.10

zor1984qq commented 5 years ago

ccache CC=g++ make -f source/linux/Makefile compile ccache: error: Could not find compiler "CC=g++" in PATH damn ccache, I try to run it just straight forward without it...doesn't know wtf wrong with ccache @_@

Does ubuntu snap has music in its package? I mean how to place music in "sudo snap install starruler2" if its now available from the snap package?

I see no music when running snapped version...how to figure out how I can add it from the GOG.com version to the snap package?

The bad thing I cannot add music to the .snap'ed package ;( its already snapped and mounted onto the file system. But at least it works...anyway I have a gog.com version on the way...

and I have same shit with CC=g++

:(.text+0x14862): undefined reference to `pthread_rwlock_wrlock' :(.text+0x1488e): undefined reference to `pthread_rwlock_unlock' /tmp/ccZODXbG.ltrans7.ltrans.o: In function `destroyMod()': :(.text+0xe712): undefined reference to `__glewDeleteProgram' /tmp/ccZODXbG.ltrans7.ltrans.o: In function `initGame()': :(.text+0x17c1d): undefined reference to `pthread_create' :(.text+0x17c4a): undefined reference to `pthread_create' /tmp/ccZODXbG.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1aec): undefined reference to `pthread_create' /tmp/ccZODXbG.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1b36): undefined reference to `pthread_create' /tmp/ccZODXbG.ltrans7.ltrans.o: In function `std::_Function_handler::_M_invoke(std::_Any_data const&)': :(.text+0x1b8b): undefined reference to `pthread_create' collect2: error: ld returned 1 exit status source/linux/Makefile:322: recipe for target 'bin/lin64/StarRuler2.bin' failed make: *** [bin/lin64/StarRuler2.bin] Error 1 I doen't intend to fix makefile myself like these guy from these post https://github.com/BlindMindStudios/StarRuler2-Source/issues/5 But yeah thx for the article at least I know that devs doesn't give a fuck about it :D but ubuntu snappers are in :D
RyanNerd commented 5 years ago

@zor1984qq I got past the errors in your log vomit by forcing g++ version 8:

CC=g++-8 make -f source/linux/Makefile compile

However this results in new (and maybe improved) log vomit:

-- Generating done
-- Build files have been written to: xxxxxxx blah blah blah
...
[100%] Built target glfw
...
#./source/linux/build.sh 64 release breakpad
lto1: fatal error: bytecode stream in file ‘obj/lin64/libangelscript.a’ generated with LTO version 6.0 instead of the expected 7.0
compilation terminated.
lto-wrapper: fatal error: g++-8 returned 1 exit status
compilation terminated.
/usr/bin/x86_64-linux-gnu-ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
source/linux/Makefile:326: recipe for target 'bin/lin64/StarRuler2.bin' failed
make: *** [bin/lin64/StarRuler2.bin] Error 1