Bridge Command Forum

General Category => General Discussion => Topic started by: elir71 on May 23, 2016, 02:57:40 PM

Title: Compiling under Linux Fedora 23
Post by: elir71 on May 23, 2016, 02:57:40 PM
I've installed the C++ libraries for gcc ... g++

I've not had any success in compiling bridgecommand

Has anyone else had more success ?
Title: Re: Compiling under Linux Fedora 23
Post by: forum_admin on May 26, 2016, 05:53:16 PM
Hi, are you able to post the output you get when trying to compile? At what stage is the process failing (I presume you've seen the instructions at https://github.com/bridgecommand/bc/blob/master/CompilingLinuxAndMac.txt)
Title: Re: Compiling under Linux Fedora 23
Post by: elir71 on May 28, 2016, 10:05:47 PM
when compiling Irrlicht then

COpenGLExtensionHandler.h:60:20: fatal error: GL/gl.h: No such file or directory
compilation terminated
<builtin>: recipe fot target 'COpenGLDriver.o' failed
make: *** [COpenGLDriver.o] Error 1


is it something to do with what is described here
http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=49811
Title: Re: Compiling under Linux Fedora 23
Post by: forum_admin on June 01, 2016, 06:08:27 PM
Hi,

I think it's more likely that you just need to install the OpenGL development package (which will include gl.h)

I'm not sure of the exact package name for fedora, but should be something like opengl-dev.

I use ubuntu, with debian based package management, but I can post a list of the packages I needed to install (from memory, the development packages for OpenGL,  X11, and a few others)
Title: Re: Compiling under Linux Fedora 25
Post by: elir71 on May 28, 2017, 05:12:15 PM
any hints as towards whats going wrong here .  I am trying to compile under fedora 25

sh-4.3# ls
changesForBC.txt  irrlicht-1.8.1
sh-4.3# cd irrlicht-1.8.1/
sh-4.3# ls
changes.txt  include  lib  readme.txt  source
sh-4.3# less readme.txt
sh-4.3# exit
exit
[root@localhost bc-master]# exit
exit
[root@localhost bc-master]# clear


























[root@localhost bc-master]# make
Makefile:44: Building...
g++ -I./libs/Irrlicht/irrlicht-1.8.1/include -I/usr/X11R6/include -std=c++11 -I./libs/enet/enet-1.3.11/include -O3 -ffast-math main.cpp Angles.cpp Buoy.cpp Buoys.cpp Camera.cpp GUIMain.cpp HeadingIndicator.cpp IniFile.cpp LandLights.cpp LandObject.cpp LandObjects.cpp Lang.cpp Light.cpp MyEventReceiver.cpp NavLight.cpp Network.cpp NetworkPrimary.cpp NetworkSecondary.cpp NMEA.cpp OtherShip.cpp OtherShips.cpp OutlineScrollBar.cpp OwnShip.cpp RadarCalculation.cpp RadarScreen.cpp Rain.cpp RealisticWater.cpp ScenarioChoice.cpp ScenarioDataStructure.cpp ScrollDial.cpp Ship.cpp SimulationModel.cpp Sky.cpp StartupEventReceiver.cpp Terrain.cpp Tide.cpp Utilities.cpp Water.cpp libs/enet/callbacks.c libs/enet/compress.c libs/enet/host.c libs/enet/list.c libs/enet/packet.c libs/enet/peer.c libs/enet/protocol.c libs/enet/unix.c libs/enet/win32.c libs/serial/src/impl/list_ports/list_ports_linux.cc libs/serial/src/impl/list_ports/list_ports_osx.cc libs/serial/src/impl/list_ports/list_ports_win.cc libs/serial/src/impl/unix.cc libs/serial/src/impl/win.cc libs/serial/src/serial.cc -o ./bridgecommand-bc -L./libs/Irrlicht/irrlicht-1.8.1/lib/Linux -lIrrlicht -L/usr/X11R6/lib -lGL -lXxf86vm -lXext -lX11 -lXcursor
In file included from NetworkPrimary.cpp:20:0:
Utilities.hpp: In instantiation of T Utilities::lexical_cast(std::__cxx11::string) [with T = int; std::__cxx11::string = std::__cxx11::basic_string<char>]:
NetworkPrimary.cpp:163:101:   required from here
Utilities.hpp:61:55: warning: overflow in implicit constant conversion [-Woverflow]
             var = std::numeric_limits<float>::infinity();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Utilities.hpp:69:16: warning: overflow in implicit constant conversion [-Woverflow]
            var = -std::numeric_limits<float>::infinity();;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from NetworkSecondary.cpp:23:0:
Utilities.hpp: In instantiation of T Utilities::lexical_cast(std::__cxx11::string) [with T = unsigned int; std::__cxx11::string = std::__cxx11::basic_string<char>]:
NetworkSecondary.cpp:202:95:   required from here
Utilities.hpp:61:55: warning: overflow in implicit constant conversion [-Woverflow]
             var = std::numeric_limits<float>::infinity();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Utilities.hpp:69:16: warning: overflow in implicit constant conversion [-Woverflow]
            var = -std::numeric_limits<float>::infinity();;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ScenarioDataStructure.cpp:18:0:
Utilities.hpp: In instantiation of T Utilities::lexical_cast(std::__cxx11::string) [with T = unsigned int; std::__cxx11::string = std::__cxx11::basic_string<char>]:
ScenarioDataStructure.cpp:156:69:   required from here
Utilities.hpp:61:55: warning: overflow in implicit constant conversion [-Woverflow]
             var = std::numeric_limits<float>::infinity();
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
Utilities.hpp:69:16: warning: overflow in implicit constant conversion [-Woverflow]
            var = -std::numeric_limits<float>::infinity();;
            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccM50sQ7.o: undefined reference to symbol '_ZN3irr4core21LOCALE_DECIMAL_POINTSE'
/usr/lib64/libIrrXML.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:44: recipe for target 'all' failed
make: *** [all] Error 1
[root@localhost bc-master]#


David Evans
Title: Re: Compiling under Linux Fedora 25
Post by: elir71 on May 29, 2017, 03:41:42 PM
Ok, under fedora 25 I have downloaded the most recent stable sources and some progress has been made quite a few less errors and warnings, however its still not compiling

[davide@localhost bc-5.0]$ make
Makefile:44: Building...
g++ -I./libs/Irrlicht/irrlicht-svn/include -I/usr/X11R6/include -std=c++11 -I./libs/enet/enet-1.3.11/include -O3 -ffast-math main.cpp Angles.cpp Buoy.cpp Buoys.cpp Camera.cpp DefaultEventReceiver.cpp FFTWave.cpp GUIMain.cpp GUIRectangle.cpp HeadingIndicator.cpp IniFile.cpp LandLights.cpp LandObject.cpp LandObjects.cpp Lang.cpp Light.cpp MovingWater.cpp MyEventReceiver.cpp NMEA.cpp NavLight.cpp Network.cpp NetworkPrimary.cpp NetworkSecondary.cpp NumberToImage.cpp OtherShip.cpp OtherShips.cpp OutlineScrollBar.cpp OwnShip.cpp RadarCalculation.cpp RadarScreen.cpp Rain.cpp ScenarioChoice.cpp ScenarioDataStructure.cpp ScrollDial.cpp Ship.cpp SimulationModel.cpp Sky.cpp StartupEventReceiver.cpp Terrain.cpp Tide.cpp Utilities.cpp Water.cpp libs/enet/callbacks.c libs/enet/compress.c libs/enet/host.c libs/enet/list.c libs/enet/packet.c libs/enet/peer.c libs/enet/protocol.c libs/enet/unix.c libs/enet/win32.c libs/serial/src/impl/list_ports/list_ports_linux.cc libs/serial/src/impl/list_ports/list_ports_osx.cc libs/serial/src/impl/list_ports/list_ports_win.cc libs/serial/src/impl/unix.cc libs/serial/src/impl/win.cc libs/serial/src/serial.cc -o ./bridgecommand-bc -L./libs/Irrlicht/irrlicht-svn/lib/Linux -lIrrlicht -L/usr/X11R6/lib -lGL -lXxf86vm -lXext -lX11 -lXcursor
/usr/bin/ld: /tmp/cciGPdvL.o: undefined reference to symbol '_ZN3irr4core21LOCALE_DECIMAL_POINTSE'
/usr/lib64/libIrrXML.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Makefile:44: recipe for target 'all' failed
make: *** [all] Error 1
[davide@localhost bc-5.0]$
Title: Re: Compiling under Linux Fedora 23
Post by: elir71 on May 29, 2017, 05:33:49 PM
/usr/lib64/libIrrXML.so.1  .......... which is a symbolic link to libIrrXML.so.1.8.4
is in the filesystem although the version number is 1.8.4
Title: Re: Compiling under Linux Fedora 23
Post by: elir71 on May 29, 2017, 06:50:16 PM
Ok got it working I followed the instructions on https://github.com/bridgecommand/bc/blob/master/CompilingLinuxAndMac.txt
taken from the above .........

1) Change directory to ./libs/Irrlicht/irrlicht-svn/source/Irrlicht
2) Run 'make' to compile irrlicht (1.9 from svn plus minor changes for Bridge Command)
3) cd back to this directory
4) Run 'make' to compile Bridge Command
(Additional steps are optional to build the additional programs - you can now run ./bridgecommand-bc)

5) cd to ./controller
6) Run 'make' to compile the Map Controller, and cd ..
7) cd to ./editor
8) Run 'make' to compile the Scenario editor, and cd ..
9) cd to ./iniEditor
10) Run 'make' to compile the Settings editor, and cd ..
11) cd to ./launcher
12) Run 'make' to compile the launcher, and cd ..

Running
13) Run ./bridgecommand to start the simulator.


Works well on fedora 25 and seems to run a lot smoother than on windows on the same hardware (dual boot older laptop)
Title: Re: Compiling under Linux Fedora 23
Post by: elir71 on May 18, 2018, 06:49:16 AM
Compiling under fedora 28

compiling irrlicht went ok

however there seems to be an issue when compiling bc


/tmp/cc8W3eNN.o: In function `main.cold.225':
main.cpp:(.text.unlikely+0x57): undefined reference to `Sound::~Sound()'
/tmp/cc8W3eNN.o: In function `main':
main.cpp:(.text.startup+0x196b): undefined reference to `Sound::Sound()'
main.cpp:(.text.startup+0x21fb): undefined reference to `Sound::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
main.cpp:(.text.startup+0x2295): undefined reference to `Sound::StartSound()'
main.cpp:(.text.startup+0x2823): undefined reference to `Sound::~Sound()'
/tmp/ccvPnksi.o: In function `SimulationModel::setPortEngine(float)':
SimulationModel.cpp:(.text+0xd6c): undefined reference to `Sound::setVolumeEngine(float)'
/tmp/ccvPnksi.o: In function `SimulationModel::setStbdEngine(float)':
SimulationModel.cpp:(.text+0xdff): undefined reference to `Sound::setVolumeEngine(float)'
/tmp/ccvPnksi.o: In function `SimulationModel::startHorn()':
SimulationModel.cpp:(.text+0x1700): undefined reference to `Sound::setVolumeHorn(float)'
/tmp/ccvPnksi.o: In function `SimulationModel::endHorn()':
SimulationModel.cpp:(.text+0x171c): undefined reference to `Sound::setVolumeHorn(float)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:45: all] Error 1
Title: Solution to compiling under Fedora 28
Post by: elir71 on May 18, 2018, 07:58:39 AM
(this possibly applies to many other compilations also)

The sound routines were not included in the Makefile so the solution is to edit the Make file and

Insert Sound.cpp into the line as shown below

Code: [Select]

# List of source files, separated by spaces
Sources := main.cpp Angles.cpp Buoy.cpp Buoys.cpp Camera.cpp DefaultEventReceiver.cpp FFTWave.cpp GUIMain.cpp GUIRectangle.cpp HeadingIndicator.cpp IniFile.cpp LandLights.cpp LandObject.cpp LandObjects.cpp Lang.cpp Light.cpp ManOverboard.cpp MovingWater.cpp MyEventReceiver.cpp NMEA.cpp NavLight.cpp Network.cpp NetworkPrimary.cpp NetworkSecondary.cpp NumberToImage.cpp OtherShip.cpp OtherShips.cpp OutlineScrollBar.cpp OwnShip.cpp RadarCalculation.cpp RadarScreen.cpp Rain.cpp ScenarioChoice.cpp ScenarioDataStructure.cpp ScrollDial.cpp Ship.cpp SimulationModel.cpp Sky.cpp Sound.cpp StartupEventReceiver.cpp Terrain.cpp Tide.cpp Utilities.cpp Water.cpp libs/enet/callbacks.c libs/enet/compress.c libs/enet/host.c libs/enet/list.c libs/enet/packet.c libs/enet/peer.c libs/enet/protocol.c libs/enet/unix.c libs/enet/win32.c libs/serial/src/impl/list_ports/list_ports_linux.cc libs/serial/src/impl/list_ports/list_ports_osx.cc libs/serial/src/impl/list_ports/list_ports_win.cc libs/serial/src/impl/unix.cc libs/serial/src/impl/win.cc libs/serial/src/serial.cc



after that it compiles fine
Title: Re: Compiling under Linux Fedora 28
Post by: elir71 on May 19, 2018, 04:23:04 PM
I have added this as a fork for incorporation on github
Title: Re: Compiling under Linux Fedora 23
Post by: forum_admin on May 19, 2018, 07:14:10 PM
Thanks, I'll merge this.