0

I'm trying to install 2Pong on Ubuntu for doing an experiment but I cannot figure out how to get it running. I installed all the requirements and followed the instructions in the README file but after many searches I still can't find a solution.

I also tried to follow the SDL instructions on their website but without success.

The README states:

Requirements:

  • SDL
  • SDL_Net
  • SDL_Mixer
  • iconv
  • zlib
  • libxml2

Compiling:

  • cd src
  • make

I installed everything but when I try to execute:

sudo make src

I get:

make: Nothing to be done for 'src'.

The files in the folder are: 2Pong, src(folder), README and conf.xml.

Link to the game:

http://twopong.sourceforge.net/

EDIT: My error after implementing SurvivalMachine's fix:

In file included from net.cpp:1:0:
net.h:5:10: fatal error: SDL/SDL_net.h: No such file or directory
 #include <SDL/SDL_net.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
Makefile:52: recipe for target 'net.o' failed
make: *** [net.o] Error 1
5
  • I added a fix for the SDL_net error, but here's it again: sudo apt install libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libxml2-dev – SurvivalMachine May 26 '19 at 13:42
  • Ok finally got it working thank you a ton! Would never have been able to do it without your help! – Max May 26 '19 at 14:08
  • @SurvivalMachine You should post that comment as an answer. – user880592 May 26 '19 at 16:48
  • @GabrielaGarcia I already added the command into my answer before posting the comment. – SurvivalMachine May 26 '19 at 17:07
  • @SurvivalMachine Sorry for bothering. This question came under review and I didn't notice you had already posted an answer. +1 – user880592 May 26 '19 at 17:10
1

This step is wrong:

sudo make src

Instead you should go into src and run make:

cd src
make

To get correct dependencies, run these commands:

sudo apt install libsdl1.2-dev libsdl-net1.2-dev libsdl-mixer1.2-dev libxml2-dev

It looks like it's configured to compile as 32-bit application, so to compile on modern systems edit Makefile and remove -march=i486 -mcpu=i686 from CFLAGS and CXXFLAGS.

There is also some code that does not compile without modifications. Open defs.h and find these lines:

rectangle defines::UpperBound();
rectangle defines::LowerBound();
rectangle defines::RightBound();
rectangle defines::LeftBound();

Remove defines:: so it looks like this:

rectangle UpperBound();
rectangle LowerBound();
rectangle RightBound();
rectangle LeftBound();
8
  • I tried that before but i get: make: *** No targets specified and no makefile found. Stop. – Max May 26 '19 at 12:37
  • I just downloaded it and src directory does contain Makefile. You must be running make from some other directory. – SurvivalMachine May 26 '19 at 12:38
  • @Max did you download 2pong-src-1.0.1a.tar.gz? – SurvivalMachine May 26 '19 at 12:42
  • I extracted the tar.gz file to my Desktop and ran: ubuntu@ubuntu:~/Desktop/2Pong-Linux/src$ make Is this correct? – Max May 26 '19 at 12:44
  • @Max If you run ls in the directory and see a Makefile, then it is the correct directory. – SurvivalMachine May 26 '19 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.