unable to compile PCem under Linux

Discussion of development and patch submission.
Post Reply
Katakis
Posts: 97
Joined: Thu 05 Mar, 2015 6:42 am

unable to compile PCem under Linux

Post by Katakis » Thu 20 Dec, 2018 7:02 am

I am a new Linux user that switched over from macOS, and I am trying to compile under Pinguy 18.04 (which is based on Ubuntu 18.04). I made sure that I had sdl2, wxWidgets, and OpenAL installed first. But when I enter "./configure --enable-release", it returns with this error: 'C compiler cannot create executables'.
./configure --enable-release
configure: WARNING: unrecognized options: --enable-release
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/glenn/Games/Emulators/PC':
configure: error: C compiler cannot create executables
See `config.log' for more details

szadycbr
Posts: 290
Joined: Mon 21 Nov, 2016 6:23 pm

Re: unable to compile PCem under Linux

Post by szadycbr » Thu 20 Dec, 2018 7:55 am

isnt c++ or g++ necessary? it says "checking whether the C compiler works... no" ,open synaptic and look for it. thats what i would do, but i dont really know.

PS: it should look more or less like this :

Code: Select all

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether to build for release... yes
checking whether to enable debugging... no
checking whether to enable networking... no
checking whether to use ALSA for MIDI output... no
checking for cpu... x86_64
checking for off64_t... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SDL... yes
checking for wx-config... /usr/bin/wx-config
checking for wxWidgets version >= 3.0.0... yes (version 3.0.2)
checking for wxWidgets static library... no
checking for pthread_create in -lpthread... yes
checking for glGetError in -lGL... yes
checking for alGetError in -lopenal... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands

szadycbr
Posts: 290
Joined: Mon 21 Nov, 2016 6:23 pm

Re: unable to compile PCem under Linux

Post by szadycbr » Thu 20 Dec, 2018 9:01 am

hmm...??? and i got this

Code: Select all

 pcem-wx-config.o: In function `config_dlgsave':
wx-config.c:(.text+0x3252): undefined reference to `loadbios'
pcem-pc.o: In function `initpc':
pc.c:(.text+0x1a5f): undefined reference to `loadbios'
pcem-video.o:(.data.rel+0xe28): undefined reference to `sigma_device'
pcem-wx-sdl2.o: In function `wx_start':
wx-sdl2.c:(.text+0x1579): undefined reference to `loadbios'
pcem-wx-sdl2.o: In function `start_emulation':
wx-sdl2.c:(.text+0x16c1): undefined reference to `loadbios'
wx-sdl2.c:(.text+0x178a): undefined reference to `loadbios'
collect2: error: ld returned 1 exit status
Makefile:806: recipe for target 'pcem' failed
make[1]: *** [pcem] Error 1
make[1]: Leaving directory '/home/szady/Downloads/pcem_emulator-pcem-bad1d550d2b3/src'
Makefile:365: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

szadycbr
Posts: 290
Joined: Mon 21 Nov, 2016 6:23 pm

Re: unable to compile PCem under Linux

Post by szadycbr » Thu 20 Dec, 2018 9:09 am

and again, despite all problems during configure it still compiles fine from src folder by "make -f Makefile.linux64-wx-sdl2" ??? so what is it that i am missing by using this command insted of ./configure and make?

User avatar
Tux
Posts: 14
Joined: Thu 03 May, 2018 6:36 pm
Location: Germany

Re: unable to compile PCem under Linux

Post by Tux » Thu 20 Dec, 2018 1:23 pm

Katakis, your posting says:

Code: Select all

checking whether the C compiler works... no
configure: error: in `/home/glenn/Games/Emulators/PC':
configure: error:C compiler cannot create executables
C compiler cannot create executables... uh oh...

check if you have write permission in folder `/home/glenn/Games/Emulators/PC`,
this is the most common error for this message.

BTW you might want networking and sound (ALSA) support, too, so I recommend to configure as:

./configure --prefix=/usr/local --enable-networking --enable-alsa --enable-release-build

User avatar
Tux
Posts: 14
Joined: Thu 03 May, 2018 6:36 pm
Location: Germany

Re: unable to compile PCem under Linux

Post by Tux » Thu 20 Dec, 2018 1:37 pm

szadycbr, your posting says (just citing one of several similar examples):

Code: Select all

wx-sdl2.c:(.text+0x16c1): undefined reference to `loadbios'
Either you have edited the file wx-sdl2.c, or deleted the file mem.h,
or (more likely) your configure process is/was messed up.

Explanation: In wx-sdl2.c you should have the line
#include "mem.h"
and in mem.h you find the reference to `loadbios' (as "int loadbios();")

So, if you didn't edit/change/delete some source files,
reconfigure.

andr25352
Posts: 9
Joined: Sun 12 Feb, 2017 9:50 am

Re: unable to compile PCem under Linux

Post by andr25352 » Thu 20 Dec, 2018 2:15 pm

Have you installed build-essential?

sudo apt-get install build-essential

Katakis
Posts: 97
Joined: Thu 05 Mar, 2015 6:42 am

Re: unable to compile PCem under Linux

Post by Katakis » Fri 21 Dec, 2018 1:02 am

It seems to get rid of the "C compiler cannot create executables" message, I needed to install g++.

Now my output looks like this:

Code: Select all

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether to build for release... no
checking whether to enable debugging... no
checking whether to enable networking... no
checking whether to use ALSA for MIDI output... no
checking for cpu... x86_64
checking for off64_t... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SDL... no
checking for sdl2-config... no
checking for SDL2.framework... 
dirname: missing operand
Try 'dirname --help' for more information.
checking for wx-config... no
configure: error: 
      wxWidgets must be installed on your system.

      Please check that wx-config is in path, the directory
      where wxWidgets libraries are installed (returned by
      'wx-config --libs' or 'wx-config --static --libs' command)
      is in LD_LIBRARY_PATH or equivalent variable and
      wxWidgets version is 3.0.0 or above.
That is funny, I thought build-essential would have installed the required files (SDL2, wxWidgets, and OpenAL), but aparrently not. As for wxWidget, the only thing I installed via Sypnatic that was related to that was wx-common. The description said "Cross-platform C++ GUI toolkit (common support files)"

Will keep trying...

shermanp
Posts: 122
Joined: Sat 18 Feb, 2017 2:09 am

Re: unable to compile PCem under Linux

Post by shermanp » Fri 21 Dec, 2018 4:58 am

Hi, build-essential, contains the the essential tools to build any C program, and only the essentials. Basically, a compiler (GCC), make and a few other essentials. You will need to install SDL2, OpenAL, wxWidgets via your package manager.

If running debian, or ubuntu, or a distribution derived from those (like mint), you will the "-dev" versions of the packages as well.

For wxWidgets, you usually need the package wxgtk (or whatever it's called). In ubuntu, you want "libwxgtk3.0" and "libwxgtk3.0-dev"

szadycbr
Posts: 290
Joined: Mon 21 Nov, 2016 6:23 pm

Re: unable to compile PCem under Linux

Post by szadycbr » Fri 21 Dec, 2018 7:21 am

Katakis, shermap said right, most of the libs should have -dev at the end , as this are libs for developers, you will get there, it is very simple, and after you have sane environment and it still causes you problems , go to src folder and execute : make -f Makefile.linux64-wx-sdl2 it should compile with no errors. as sherman isntruct you , do install libsdl2-dev (in debian) and libwxgtk3.0-dev and you should be good to go, if not, ./config will give you clues :)

PS. libopenal-dev aslo, as it will complain if you dont have it.

User avatar
te_lanus
Posts: 93
Joined: Tue 28 Jul, 2015 4:47 am

Re: unable to compile PCem under Linux

Post by te_lanus » Fri 21 Dec, 2018 5:41 pm

For me I normally run these commands and it is normally enough to get most stuff compiling :

Code: Select all

sudo apt-get install git build-essential libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default cmake libgtk-3-dev mercurial
sudo apt-get install subversion g++ libqt5-dev libqtwebkit-dev libphonon-dev libxmu-dev libqt5-sql-sqlite rsync

Katakis
Posts: 97
Joined: Thu 05 Mar, 2015 6:42 am

Re: unable to compile PCem under Linux

Post by Katakis » Sat 22 Dec, 2018 6:25 am

te_lanus wrote:
Fri 21 Dec, 2018 5:41 pm
For me I normally run these commands and it is normally enough to get most stuff compiling :

Code: Select all

sudo apt-get install git build-essential libsdl2-dev libsdl2-ttf-dev libfontconfig-dev qt5-default cmake libgtk-3-dev mercurial
sudo apt-get install subversion g++ libqt5-dev libqtwebkit-dev libphonon-dev libxmu-dev libqt5-sql-sqlite rsync
So when I did the first command, I get this:

Code: Select all

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libfontconfig1-dev' instead of 'libfontconfig-dev'
build-essential is already the newest version (12.4ubuntu1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libgtk-3-dev : Depends: libegl1-mesa-dev but it is not going to be installed
 libsdl2-dev : Depends: libasound2-dev but it is not going to be installed
               Depends: libegl1-mesa-dev but it is not going to be installed
               Depends: libgl1-mesa-dev but it is not going to be installed
               Depends: libgles2-mesa-dev but it is not going to be installed
               Depends: libglu1-mesa-dev but it is not going to be installed
               Depends: libpulse-dev but it is not going to be installed
 qt5-default : Depends: qtbase5-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I don't think I can issue the second command if the first isn't successful.

szadycbr
Posts: 290
Joined: Mon 21 Nov, 2016 6:23 pm

Re: unable to compile PCem under Linux

Post by szadycbr » Sat 22 Dec, 2018 9:02 am

Katakis , i think you allready have all you need, do ./configure once again and see whats missing , libgtk-3-dev isnt requried, i dont use it. what distro are you using ,ubuntu stable/testing ? remember , if you try download separate libs from internet you must install correct version, otherwise dependiencies will start to crumble and soon you will be in unrecoverable mess :) better use synaptic. libsdl2-dev needs to be installed, you can check in synaptic what dependiences needs to be meet and if there are any conflicts. when it says "Depends: lib......... but it is not going to be installed" means that probably you did download some libs from internet and installed manually without checking correct version. have you installed libs manually? cos that what it looks to me :)

Katakis
Posts: 97
Joined: Thu 05 Mar, 2015 6:42 am

Re: unable to compile PCem under Linux

Post by Katakis » Tue 08 Jan, 2019 6:31 am

Good news.

The main problem was with PinguyOS 18.04. It would not let me compile PCem in a Terminal without complaining about broken dependencies, and when I tried to install those ones, it gave me more dependencies to worry about, and then it went on and on until I just gave up. Even when I tried with sypnatic, all that resulted was a red checkbox with an exclamation mark in it. Pinguy would not even install Wine. I ended up switching distros to LMDE 3, and everything works like a dream.

The only errors I get are these, but I guess they are nothing to worry about.

Code: Select all

Set fullspeed - 0 0 0
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for 4294967295, skipping unlock
Many thanks to all that have helped me. You guys are awesome!

Image

Post Reply