Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Compiling with make


Guest
 Share

Recommended Posts

I'm trying to compile to compile [Naked MUD 3.8.1](http://homepages.uc.edu/~hollisgf/nakedmud.html). I'm pretty ecstatic about it because it uses Python as a scripting language. However, I'm trying to compile the source folder using the command make on Ubuntu. This returns:
```
Compiling gameloop.c
In file included from gameloop.c:39:
scripts/scripts.h:25:20: error: Python.h: No such file or directory
scripts/scripts.h:26:26: error: structmember.h: No such file or directory
In file included from gameloop.c:39:
scripts/scripts.h:73: error: expected declaration specifiers or ‘...’ before ‘PyObject’
scripts/scripts.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:100: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:112: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:143: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:150: error: expected ‘)’ before ‘*’ token
scripts/scripts.h:155: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:162: error: expected ‘)’ before ‘*’ token
scripts/scripts.h:167: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
scripts/scripts.h:184: error: expected declaration specifiers or ‘...’ before ‘PyObject’
scripts/scripts.h:189: error: expected declaration specifiers or ‘...’ before ‘PyObject’
scripts/scripts.h:195: error: expected declaration specifiers or ‘...’ before ‘PyObject’
gameloop.c: In function ‘main’:
gameloop.c:133: warning: implicit declaration of function ‘time’
gameloop.c:182: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
make: *** [gameloop.o] Error 1

```
I have gcc and make installed. Help is greatly appreciated.
Link to comment
Share on other sites

@clamsd101:

> I'm trying to compile to compile [Naked MUD 3.8.1](http://homepages.uc.edu/~hollisgf/nakedmud.html). I'm pretty ecstatic about it because it uses Python as a scripting language. However, I'm trying to compile the source folder using the command make on Ubuntu. This returns:
> ```
> Compiling gameloop.c
> In file included from gameloop.c:39:
> scripts/scripts.h:25:20: error: Python.h: No such file or directory
> scripts/scripts.h:26:26: error: structmember.h: No such file or directory
> In file included from gameloop.c:39:
> scripts/scripts.h:73: error: expected declaration specifiers or ‘...’ before ‘PyObject’
> scripts/scripts.h:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:89: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:90: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:91: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:92: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:97: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:98: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:99: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:100: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:108: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:112: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:143: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:150: error: expected ‘)’ before ‘*’ token
> scripts/scripts.h:155: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:162: error: expected ‘)’ before ‘*’ token
> scripts/scripts.h:167: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
> scripts/scripts.h:184: error: expected declaration specifiers or ‘...’ before ‘PyObject’
> scripts/scripts.h:189: error: expected declaration specifiers or ‘...’ before ‘PyObject’
> scripts/scripts.h:195: error: expected declaration specifiers or ‘...’ before ‘PyObject’
> gameloop.c: In function ‘main’:
> gameloop.c:133: warning: implicit declaration of function ‘time’
> gameloop.c:182: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
> make: *** [gameloop.o] Error 1
>
> ```
> I have gcc and make installed. Help is greatly appreciated.

It says you don't have Python.h which means you don't have the Python SDK/development files installed. Open a terminal and try apt-get install python-dev.

The other errors currently make no sense and I'm not sure if they're caused by the missing python-dev or not.

Regards,
  Godlord.
Link to comment
Share on other sites

I already have python-dev installed.  :sad:

EDIT: Trying python3-dev, cause the repository python is 2.6 iirc. Worth a shot.

EDIT: It says it needs python 2.3 or above.
Link to comment
Share on other sites

@clamsd101:

> I already have python-dev installed.  :sad:
>
> EDIT: Trying python3-dev, cause the repository python is 2.6 iirc. Worth a shot.
>
> EDIT: It says it needs python 2.3 or above.

Sounds like an invalid include then.

The headers in development packages usually get installed into /usr/include/ which is the root of your header directory. Check that location.

Regards,
  Godlord.
Link to comment
Share on other sites

/usr/include/python2.5/Python.h is well Python 2.5
/usr/include/python2.6/Python.h
/usr/include/python3.0/Python.h
Where the source for Naked MUD is:
/home/karl/Desktop/Naked Mud codebase/nakedmudv3.8.1/src/
Link to comment
Share on other sites

Adding #include now makes
```
Building dependencies for help2/help.c
Building dependencies for alias/alias.c
Building dependencies for time/time.c
Building dependencies for scripts/pyolc.c
Building dependencies for scripts/trighooks.c
Building dependencies for scripts/trigedit.c
Building dependencies for scripts/triggers.c
Building dependencies for scripts/pyevent.c
Building dependencies for scripts/script_editor.c
Building dependencies for scripts/pysocket.c
Building dependencies for scripts/pyaccount.c
Building dependencies for scripts/pyexit.c
Building dependencies for scripts/pyroom.c
Building dependencies for scripts/pyhooks.c
Building dependencies for scripts/pymudsys.c
Building dependencies for scripts/pymud.c
Building dependencies for scripts/pyobj.c
Building dependencies for scripts/pychar.c
Building dependencies for scripts/scripts.c
Building dependencies for items/worn.c
Building dependencies for items/furniture.c
Building dependencies for items/container.c
Building dependencies for items/iedit.c
Building dependencies for items/portal.c
Building dependencies for items/items.c
Building dependencies for editor/notepad.c
Building dependencies for editor/editor.c
Building dependencies for olc2/olc_extender.c
Building dependencies for olc2/protedit.c
Building dependencies for olc2/oedit.c
Building dependencies for olc2/medit.c
Building dependencies for olc2/redit.c
Building dependencies for olc2/olc.c
Building dependencies for command.c
Building dependencies for parse.c
Building dependencies for prototype.c
Building dependencies for room_reset.c
Building dependencies for socket.c
Building dependencies for handler.c
Building dependencies for interpret.c
Building dependencies for gameloop.c
Compiling gameloop.c
In file included from gameloop.c:39:
scripts/scripts.h:26:26: error: structmember.h: No such file or directory
gameloop.c: In function ‘main’:
gameloop.c:182: warning: ignoring return value of ‘chdir’, declared with attribute warn_unused_result
make: *** [gameloop.o] Error 1

```
Link to comment
Share on other sites

Here's the startup.txt:

> Startup should be pretty easy. To compile, simply go into the src directory and
> type "make". Everything should compile automagically. From here, to start, you
> simply type ./NakedMud [port] & If you do not supply a port, the MUD will
> start up on port 4000 by default.
>
> If you're having troubles compiling when it gets to the scripts, you will want
> to read src/scripts/module.mk
>
> If you've got other problems and cannot figure out what to do, you can try
> giving me a description of your problem, and I'll see if I can help you out. No
> promises, though.
>
> Geoff Hollis
> [email protected]
> http://www.uc.edu/~hollisgf/

Looks like I'm researching and emailing Geoff Hollis.

I like how he uses the word "automagically".

EDIT:
OH!
```
If you're having troubles compiling when it gets to the scripts, you will want
to read src/scripts/module.mk
```
Link to comment
Share on other sites

Oddly enough, locate Python.h only finds /usr/include/python2.5/Python.h and /usr/include/python2.6/Python.h, not /usr/include/python3.0/Python.h
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...