Make error - can't open file

Asked by Tomasz Lewicki

I'd like to compile Nightshade Legacy from source on fresh install of Ubuntu 16.10. I mirrored NS from Launchpad with 'bzr branch lp:nightshade' with 206 revisions. Tree is up-to-date.

After installing all needed tools and dependencies, I made 'configure' step and then 'make'. I got an error:

/usr/include/c++/6/ostream:628:5: note: conversion of argument 1 would be ill-formed:
constellation_mgr.cpp:236:8: error: cannot bind ‘std::basic_ostream<char>’ lvalue to ‘std::basic_ostream<char>&&
   cerr << "Can't open file" << artFile << endl;
   ~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/iostream:39:0,
                 from constellation_mgr.cpp:28:

What should I do?

Question information

Language:
English Edit question
Status:
Solved
For:
Nightshade Legacy Edit question
Assignee:
No assignee Edit question
Solved by:
Tomasz Lewicki
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Just a shot in the dark:

change line 236 of constellation_mgr.cpp from
cerr << "Can't open file" << artFile << endl
into
cerr << "Can't open file" << artfileName.c_str() << endl

Does it compile now?

Revision history for this message
Tomasz Lewicki (stalkerpl) said :
#2

Manfred, thank you. It helped. But I compiled NS several times before in last years and never encountered this error.

But... there is another thing:

/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick `GraphicsMagick++-config --libs` -o nightshade object.o object_base.o constellation.o constellation_mgr.o nebula.o nebula_mgr.o planet.o solarsystem.o hip_star.o hip_star_mgr.o main.o sdl_facade.o core.o utility.o geodesic_grid.o zone_array.o sphere_geometry.o hip_star_wrapper.o atmosphere.o grid.o navigator.o draw.o s_texture.o s_font.o string_array.o orbit.o skylight.o skybright.o tone_reproductor.o init_parser.o s_gui.o ui.o ui_conf.o ui_tuiconf.o projector.o custom_projector.o stereographic_projector.o spheric_mirror_projector.o spheric_mirror_calculator.o viewport_distorter.o mapping.o mapping_classes.o observer.o fisheye_projector.o landscape.o s_tui.o meteor.o meteor_mgr.o sky_localizer.o command_interface.o command_nshade.o app_command_interface.o script_mgr.o script.o image_mgr.o image.o audio.o loadingbar.o translator.o app.o shared_data.o external_viewer.o GLee.o app_settings.o signals.o program_object.o shader.o night_shader.o bump_shader.o ring_shader.o ringed_shader.o named_sockets.o ../nscontrol/src/libnscontrol.la -lboost_system -lboost_filesystem -lboost_regex /usr/local/lib/libfastdb.a ../src/planetsephems/libstellplanet.a ../src/stellastro/libstellastro.a ../src/iniparser/libiniparser.a -lm -lrt -L/usr/lib/x86_64-linux-gnu -lSDL -lpng -lz -lSDL_mixer -lSDL_Pango -lGLU -lGL -lm -lrt
libtool: link: g++ -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -Wall -fpermissive -I/usr/include/GraphicsMagick -o .libs/nightshade object.o object_base.o constellation.o constellation_mgr.o nebula.o nebula_mgr.o planet.o solarsystem.o hip_star.o hip_star_mgr.o main.o sdl_facade.o core.o utility.o geodesic_grid.o zone_array.o sphere_geometry.o hip_star_wrapper.o atmosphere.o grid.o navigator.o draw.o s_texture.o s_font.o string_array.o orbit.o skylight.o skybright.o tone_reproductor.o init_parser.o s_gui.o ui.o ui_conf.o ui_tuiconf.o projector.o custom_projector.o stereographic_projector.o spheric_mirror_projector.o spheric_mirror_calculator.o viewport_distorter.o mapping.o mapping_classes.o observer.o fisheye_projector.o landscape.o s_tui.o meteor.o meteor_mgr.o sky_localizer.o command_interface.o command_nshade.o app_command_interface.o script_mgr.o script.o image_mgr.o image.o audio.o loadingbar.o translator.o app.o shared_data.o external_viewer.o GLee.o app_settings.o signals.o program_object.o shader.o night_shader.o bump_shader.o ring_shader.o ringed_shader.o named_sockets.o -lGraphicsMagick++ -lGraphicsMagick -ljbig -lwebp -llcms2 -ltiff /usr/lib/x86_64-linux-gnu/libfreetype.so -ljpeg -lpng16 -lwmflite -lXext -lSM -lICE -lX11 -llzma -lbz2 -lxml2 -lgomp -lpthread ../nscontrol/src/.libs/libnscontrol.so -lboost_system -lboost_filesystem -lboost_regex /usr/local/lib/libfastdb.a ../src/planetsephems/libstellplanet.a ../src/stellastro/libstellastro.a ../src/iniparser/libiniparser.a -L/usr/lib/x86_64-linux-gnu -lSDL -lpng -lz -lSDL_mixer -lSDL_Pango -lGLU -lGL -lm -lrt
/usr/bin/ld: /usr/local/lib/libfastdb.a(class.o): relocation R_X86_64_32 against symbol `_ZN17dbTableDescriptor5chainE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(database.o): relocation R_X86_64_32S against symbol `_ZTV11dbException' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(hashtab.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(file.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(symtab.o): relocation R_X86_64_32 against symbol `_ZN13dbSymbolTable9hashTableE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(ttree.o): relocation R_X86_64_32S against symbol `_ZN10dbDatabase18internalObjectSizeE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(rtree.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(cursor.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(query.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(sync.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libfastdb.a(compiler.o): relocation R_X86_64_32 against symbol `_ZN19dbExprNodeAllocator8instanceE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:604: polecenia dla obiektu 'nightshade' nie powiodły się
make[3]: *** [nightshade] Błąd 1
make[3]: Opuszczenie katalogu '/home/tomek/nightshade/src'
Makefile:741: polecenia dla obiektu 'all-recursive' nie powiodły się
make[2]: *** [all-recursive] Błąd 1
make[2]: Opuszczenie katalogu '/home/tomek/nightshade/src'
Makefile:474: polecenia dla obiektu 'all-recursive' nie powiodły się
make[1]: *** [all-recursive] Błąd 1
make[1]: Opuszczenie katalogu '/home/tomek/nightshade'
Makefile:402: polecenia dla obiektu 'all' nie powiodły się
make: *** [all] Błąd 2

"Błąd" means "error", "polecenia dla obiektu 'xxx' nie powiodły się" means "recipe for target 'xxx' failed".

Revision history for this message
Tomasz Lewicki (stalkerpl) said :
#3

OK, I found that problem related to fastdb, I'm trying to resolve it.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

Sorry, but this goes far beyond my knowledge of Nightshade Legacy.

The only hint that I can give based on your output is that libfastdb is mentioned in all these error messages.
Maybe it should be compiled position-independent (something like ( COMPILE_FLAGS+=-fPIC )

Revision history for this message
Tomasz Lewicki (stalkerpl) said :
#5

Manfred, thank you for your help. I concluded that all problems were related to "sensitivity" of GCC5 and GCC6 (I tried both) to syntax of Makefile(s). I just installed fresh version of Ubuntu 14.04.5 LTS with default compile tools and after installing all needed dependencies compilation of Nightshade went smoothly.

This thread can be closed now.