errors compiling code on Linux

Jack Claw was in development between 2006-2008 and was released in the Humble Frozenbyte Bundle for the community to play and build upon.
User avatar
Urfoex
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

errors compiling code on Linux

Postby Urfoex » Tue May 24, 2011 12:51 am

Good evening.

I tried to compile the fresh released source code (http://frozenbyte.com/temp_jackclaw/Jac ... nuxMac.zip, http://code.google.com/p/jack-claw/sour ... =linux-mac).
Had no luck with 'make -f module.mk'

Code: Select all

$ make -f module.mk
module.mk:61: /claw_proto/module.mk: No such file or directory
module.mk:61: /container/module.mk: No such file or directory
module.mk:61: /convert/module.mk: No such file or directory
module.mk:61: /editor/module.mk: No such file or directory
module.mk:61: /filesystem/module.mk: No such file or directory
module.mk:61: /game/module.mk: No such file or directory
module.mk:61: /mingw/module.mk: No such file or directory
module.mk:61: /net/module.mk: No such file or directory
module.mk:61: /ogui/module.mk: No such file or directory
module.mk:61: /particle_editor2/module.mk: No such file or directory
module.mk:61: /physics/module.mk: No such file or directory
module.mk:61: /sound/module.mk: No such file or directory
module.mk:61: /storm/module.mk: No such file or directory
module.mk:61: /system/module.mk: No such file or directory
module.mk:61: /ui/module.mk: No such file or directory
module.mk:61: /util/module.mk: No such file or directory
make: *** No rule to make target `/util/module.mk'.  Stop.

I fiddled a bit around but could not get it right.

So I tried building a CMake build script around the code starting with the Storm3D engine.
But it seems that there are some files especially class declarations missing.
Are they left out intentionally? Or should be everything inside?
Did anyone get it compiled?

Cheers!
+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Tue May 24, 2011 12:45 pm

This is what you get when there's no README (hint!)

There's a Makefile in binaries/.

1. Go to binaries

2. Copy example.mk to local.mk

3. Edit local.mk to suit your needs (CFLAGS CXX) etc.

4. Run make

5. Parallel make works. On dual core use -j2, on more (num cores - 1) is better.

Do not try to use cmake, or god forbid, autotools. They are pure shit. People who complain about GNU make do not understand it.
Turo Lamminen
Alternative Games

User avatar
Urfoex
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

Re: errors compiling code on Linux

Postby Urfoex » Tue May 24, 2011 2:37 pm

alt_turo wrote:This is what you get when there's no README (hint!)

There's a Makefile in binaries/.

1. Go to binaries

2. Copy example.mk to local.mk

3. Edit local.mk to suit your needs (CFLAGS CXX) etc.

4. Run make

5. Parallel make works. On dual core use -j2, on more (num cores - 1) is better.

Do not try to use cmake, or god forbid, autotools. They are pure shit. People who complain about GNU make do not understand it.


I followed your guide and got there:

Code: Select all

claw/binaries$ make
../module.mk:61: ../mingw/module.mk: No such file or directory
make: *** No rule to make target `../mingw/module.mk'.  Stop.


Then I removed the mingw from line 60 from claw/module.mk and got:

Code: Select all

claw/binaries$ make
g++ -c -MTclaw_proto/claw_proto.o -MFclaw_proto/claw_proto.d -MP -MMD -g -I.. -I../claw_proto -I../storm/include -I../storm/keyb3 -I/usr/include/SDL -D_REENTRANT -include ../claw_proto/configuration.h -DLIGHT_MAX_AMOUNT=5 -DNDEBUG -w -DNX32 -DLINUX -Os -ffast-math -fno-strict-aliasing -flto -DUSE_LIBAVCODEC -I/usr/include/PhysX/v2.8.3/SDKs/Physics/include -I/usr/include/PhysX/v2.8.3/SDKs/Cooking/include -I/usr/include/PhysX/v2.8.3/SDKs/NxExtensions/include -I/usr/include/PhysX/v2.8.3/SDKs/NxCharacter/include -I/usr/include/PhysX/v2.8.3/SDKs/Foundation/include -I/usr/include/PhysX/v2.8.3/SDKs/PhysXLoader/include -I. -oclaw_proto/claw_proto.o ../claw_proto/claw_proto.cpp
In file included from ../claw_proto/claw_proto.cpp:99:0:
../claw_proto/../project_common/configuration_post_check.h:27:67: note: #pragma message: VERBOSE_BUILD: PROJECT_CLAW_PROTO - Claw proto
../claw_proto/../project_common/configuration_post_check.h:37:79: note: #pragma message: VERBOSE_BUILD: LEGACY_FILES - Old directory/file structure
../claw_proto/../project_common/configuration_post_check.h:61:59: note: #pragma message: VERBOSE_BUILD: NDEBUG - Release build
../claw_proto/../project_common/configuration_post_check.h:86:62: note: #pragma message: VERBOSE_BUILD: CRYPT_... - Data encrypted
../claw_proto/claw_proto.cpp:1711:1: fatal error: opening dependency file claw_proto/claw_proto.d: No such file or directory
compilation terminated.
make: *** [claw_proto/claw_proto.o] Error 1


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I like CMake. It makes it easier for me to create and build software.
Out-Of-Source builds, automatic configuration, different project files, usable on different systems and platforms, ...
Many other people also switched to cmake like KDE, Blender, Bullet, Ogre, Lugaru, Penumbra, Ryzom.
I don't think that people would use it if it were that bad.

I haven't used autotools for any own project but did 'sh autogen.sh' and following commands quite some time and most times it worked.
I was not forced to get into some files to correct them to my needs.

Booth utilities notified me when I had some missing dependencies.

The Makefiles of "Jack Claw" first require me to get inside and change them and second they doesn't show me missing dependencies.
Third not to mention the missing possibility to build the source out of the source tree.
+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Tue May 24, 2011 3:17 pm

Urfoex wrote:

Code: Select all

../module.mk:61: ../mingw/module.mk: No such file or directory
make: *** No rule to make target `../mingw/module.mk'.  Stop.


This is a bug. mingw was left in by accident.

Then I removed the mingw from line 60 from claw/module.mk

This is the correct fix. As soon as StevenT gets the code straightened out I'll commit it.

Code: Select all

../claw_proto/claw_proto.cpp:1711:1: fatal error: opening dependency file claw_proto/claw_proto.d: No such file or directory
compilation terminated.
make: *** [claw_proto/claw_proto.o] Error 1


Bad error message on behalf of gcc and poor documentation on my behalf. The problem is that proper directory structure does not exist under binaries. Use "make bindirs" to create them. This should be added to the build instructions (README hint!) It would be possible to do this always on normal make but since it's unnecessary on the vast majority of builds I though it best to leave it as a separate step.

I like CMake. It makes it easier for me to create and build software.

For me it adds unnecessary complexity. But this is a community project and I can't stop you from adding CMake support. Just please don't break the existing system while you're at it.

Out-Of-Source builds

Supported by current system. Make directory somewhere, copy Makefile and example.mk there, copy example.mk to local.mk and change TOPDIR at the start of local.mk. (README hint!)

automatic configuration

Not much on this project to configure. And on more complex projects I prefer explicit configuration like the current example.mk/local.mk -thing. I absolutely hate autotools "oh you don't have this library let's just leave this thing out and maybe not even list missing things at the end". This behavior causes silent failures like this: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=518916 and is very bad.

different project files

What exactly do you mean by this?

usable on different systems and platforms, ...

"Do not try to write portable makefiles, use a portable make."
http://mad-scientist.net/make/rules.html

GNU make has been ported to all important platforms. It's possible to cross-compile with it (see mingw subdir) and even to use MSVC as your compiler while running under Linux. BTW that thing is one of the most glorious hacks ever and I really need to post it somewhere.

I don't think that people would use it if it were that bad.

MS Windows. Apple. Nuff said.

I haven't used autotools for any own project but did 'sh autogen.sh' and following commands quite some time and most times it worked.

There's no-one on the entire planet who understands all of autotools. Vast majority of developers just copy-and-paste stuff and hope it works. I think CMake is better but just plain GNU make is best because you don't need another moving part.

I was not forced to get into some files to correct them to my needs.

If the original dev screwed up and left in some cruft you would have.

Booth utilities notified me when I had some missing dependencies.

The Makefiles of "Jack Claw" ... doesn't show me missing dependencies.

They don't always do that like in the example above. Granted, GNU make -based system does not even do that much. It might be possible to hack it in but I don't believe it's necessary. If something's missing you get a compiler error. And if it's a small part like audio libraries then the rest of the build can proceed while you hunt for the missing library.
Turo Lamminen
Alternative Games

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Tue May 24, 2011 7:07 pm

alt_turo wrote:and even to use MSVC as your compiler while running under Linux. BTW that thing is one of the most glorious hacks ever and I really need to post it somewhere.

Here it is, one of the most perverse, glorious and f****d-up hacks I have ever written: https://github.com/turol/msvgcc

I'll add support for this monstrosity to claw build system. Then we can compile PhysX-enabled Windows versions from Linux.
Turo Lamminen
Alternative Games

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Tue May 24, 2011 7:42 pm

alt_turo wrote:
Urfoex wrote:

Code: Select all

../module.mk:61: ../mingw/module.mk: No such file or directory
make: *** No rule to make target `../mingw/module.mk'.  Stop.


This is a bug. mingw was left in by accident.


Fixed. In my correctly set up build enviroment, not an entirely simple task BTW, the only failure is this:

Code: Select all

../filesystem/zip_package.cpp:16:19: fatal error: unzip.h: No such file or directory

This file comes from minizip or something like that and should be under BSD license if I remember correctly. Do we want to add it to the source tree or should everyone get it themselves? We also need some accompanying .c source files or a library built from them.

For the build environment at least the following libraries are required (README hint!):
SDL, SDL_image, SDL_ttf, openal, glew, PhysX. All other are pretty standard except PhysX which you need to request from nvidia. If you have FMOD 3.75 you can also use it instead of OpenAL but that is not recommended.
If you set up a build environment please document all other libraries which are required.
Turo Lamminen
Alternative Games

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Fri May 27, 2011 1:50 pm

Pushed some build system changes. I can now compile a working Linux version. I can also use the msvgcc hack to build a Windows version which works at least under Wine. So it's possible to build and test the Windows versions without ever leaving Linux.
Turo Lamminen
Alternative Games

User avatar
StevenT
Posts: 29
Joined: Wed Apr 13, 2011 7:23 pm

Re: errors compiling code on Linux

Postby StevenT » Sat May 28, 2011 1:48 pm

Has Nvidia removed the Linux SDK from their site? I only see Windows and Mac SDKs available for download.

Physx seems to be the only thing that is stopping me from compiling it on Linux right now.

Btw does the Physx Linux SDK support 64bit?

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Sat May 28, 2011 8:14 pm

StevenT wrote:Has Nvidia removed the Linux SDK from their site? I only see Windows and Mac SDKs available for download.

Physx seems to be the only thing that is stopping me from compiling it on Linux right now.

You have to explicitly request it from them.

Btw does the Physx Linux SDK support 64bit?

It does. Trine uses it.
Turo Lamminen
Alternative Games

User avatar
Urfoex
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

Re: errors compiling code on Linux

Postby Urfoex » Wed Jun 01, 2011 7:39 pm

I got to the point of the missing unzip.h.
Is this that one?
http://www.winimage.com/zLibDll/minizip.html

I haven't tried because I haven't got the PhysX SDK (better to say the account to download it) yet. (They maybe don't like me 8) ). Is there an other way of getting the SDK?
+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Wed Jun 01, 2011 7:49 pm

Urfoex wrote:I got to the point of the missing unzip.h.
Is this that one?
http://www.winimage.com/zLibDll/minizip.html

Yes.

Is there an other way of getting the SDK?

Not really. You can try to get it from someone else who already has it but that's against the license conditions. If you get caught NVidia might say bad things to you. I certainly can't give it out.
Turo Lamminen
Alternative Games

bobpaul
Posts: 1
Joined: Thu Jul 28, 2011 9:13 pm

Re: errors compiling code on Linux

Postby bobpaul » Fri Jul 29, 2011 1:05 am

So I got register and nVidia has PhysX 3.0.1 SDK for linux, so I downloaded that. I decompress it and have

PhysX-3.0.1_LINUX_SDK_Core/PhysXSDK/[Bin,PhysXFoundationSDK,PhysXLoader,PhysXProfileSDK,PhysXVisualDebuggerSDK,pxtask,SDKs]

I'm not sure what to do with this directory tree I now have. The Example.mk is looking for something like /usr/lib/PhysX; /usr/include/PhysX. I don't see anything that looks like this and I don't see a script that will install it globally for me.

Is it just that they changed everything with 3? Do I have to file a support request and obtain the older 2.8.3 SDK?

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Mon Aug 01, 2011 11:25 am

bobpaul wrote:So I got register and nVidia has PhysX 3.0.1 SDK for linux, so I downloaded that.

Is it just that they changed everything with 3? Do I have to file a support request and obtain the older 2.8.3 SDK?

It would be easier to get PhysX 2.8. 2.8.3 is the one we used, 2.8.4 should also work.

I just downloaded PhysX 3.0 and it appears to have changed quite a bit. I'll take a look at getting this to compile with 3.0 but don't hold your breath.
Turo Lamminen
Alternative Games

alt_turo
Posts: 195
Joined: Mon Dec 13, 2010 11:06 am

Re: errors compiling code on Linux

Postby alt_turo » Tue Aug 02, 2011 11:29 am

alt_turo wrote:I just downloaded PhysX 3.0 and it appears to have changed quite a bit. I'll take a look at getting this to compile with 3.0 but don't hold your breath.


Both the directory structure and header names have changed and I haven't even looked at the interfaces yet... This doesn't look good. Just get the older version.
Turo Lamminen
Alternative Games

mva
Posts: 10
Joined: Thu Apr 05, 2012 9:49 am
Location: Russia, Tomsk and Moscow
Contact:

Re: errors compiling code on Linux

Postby mva » Thu Apr 19, 2012 4:00 pm

Hi guys! Does this topic still alive? ;)

I trying to compile JC on my laptop and get folowing things (with both GCC-4.5.3 and 4.6.2):

Code: Select all

[email protected] binaries % LC_ALL=C make CXX=g++-4.5.3
g++-4.5.3 -c -MTgame/BonusManager.o -MFgame/BonusManager.d -MP -MMD -g -I.. -I../claw_proto -I../storm/include -I../storm/keyb3 -I/usr/include/minizip/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -include ../claw_proto/configuration.h -DLIGHT_MAX_AMOUNT=5 -DNDEBUG -w -DNX64 -DLINUX -DNX_DISABLE_FLUIDS -Os -ffast-math -fno-strict-aliasing -DUSE_LIBAVCODEC -I/usr/include/PhysX/v2.8.1/SDKs/Physics/include -I/usr/include/PhysX/v2.8.1/SDKs/Cooking/include -I/usr/include/PhysX/v2.8.1/SDKs/NxExtensions/include -I/usr/include/PhysX/v2.8.1/SDKs/NxCharacter/include -I/usr/include/PhysX/v2.8.1/SDKs/Foundation/include -I/usr/include/PhysX/v2.8.1/SDKs/PhysXLoader/include -I. -ogame/BonusManager.o ../game/BonusManager.cpp
../game/BonusManager.cpp: In member function 'virtual void game::InvulnerabilityBonusOption::apply(game::Game*, int)':
../game/BonusManager.cpp:201:69: error: call of overloaded 'addCustomScriptProcess(const char [22], NULL, NULL)' is ambiguous
../game/../game/Game.h:209:9: note: candidates are: int game::Game::addCustomScriptProcess(const char*, game::Unit*, const std::vector<int>*)
../game/../game/Game.h:210:9: note:                 int game::Game::addCustomScriptProcess(const char*, UnifiedHandle, const std::vector<int>*)
../game/BonusManager.cpp: In member function 'virtual void game::ThirdPersonModeBonusOption::apply(game::Game*, int)':
../game/BonusManager.cpp:249:65: error: call of overloaded 'addCustomScriptProcess(const char [18], NULL, NULL)' is ambiguous
../game/../game/Game.h:209:9: note: candidates are: int game::Game::addCustomScriptProcess(const char*, game::Unit*, const std::vector<int>*)
../game/../game/Game.h:210:9: note:                 int game::Game::addCustomScriptProcess(const char*, UnifiedHandle, const std::vector<int>*)
make: *** [game/BonusManager.o] Error 1
[email protected] binaries % LC_ALL=C make CXX=g++-4.6.2
g++-4.6.2 -c -MTgame/BonusManager.o -MFgame/BonusManager.d -MP -MMD -g -I.. -I../claw_proto -I../storm/include -I../storm/keyb3 -I/usr/include/minizip/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -include ../claw_proto/configuration.h -DLIGHT_MAX_AMOUNT=5 -DNDEBUG -w -DNX64 -DLINUX -DNX_DISABLE_FLUIDS -Os -ffast-math -fno-strict-aliasing -DUSE_LIBAVCODEC -I/usr/include/PhysX/v2.8.1/SDKs/Physics/include -I/usr/include/PhysX/v2.8.1/SDKs/Cooking/include -I/usr/include/PhysX/v2.8.1/SDKs/NxExtensions/include -I/usr/include/PhysX/v2.8.1/SDKs/NxCharacter/include -I/usr/include/PhysX/v2.8.1/SDKs/Foundation/include -I/usr/include/PhysX/v2.8.1/SDKs/PhysXLoader/include -I. -ogame/BonusManager.o ../game/BonusManager.cpp
../game/BonusManager.cpp: In member function 'virtual void game::InvulnerabilityBonusOption::apply(game::Game*, int)':
../game/BonusManager.cpp:201:69: error: call of overloaded 'addCustomScriptProcess(const char [22], NULL, NULL)' is ambiguous
../game/BonusManager.cpp:201:69: note: candidates are:
../game/../game/Game.h:209:9: note: int game::Game::addCustomScriptProcess(const char*, game::Unit*, const std::vector<int>*)
../game/../game/Game.h:210:9: note: int game::Game::addCustomScriptProcess(const char*, UnifiedHandle, const std::vector<int>*)
../game/BonusManager.cpp: In member function 'virtual void game::ThirdPersonModeBonusOption::apply(game::Game*, int)':
../game/BonusManager.cpp:249:65: error: call of overloaded 'addCustomScriptProcess(const char [18], NULL, NULL)' is ambiguous
../game/BonusManager.cpp:249:65: note: candidates are:
../game/../game/Game.h:209:9: note: int game::Game::addCustomScriptProcess(const char*, game::Unit*, const std::vector<int>*)
../game/../game/Game.h:210:9: note: int game::Game::addCustomScriptProcess(const char*, UnifiedHandle, const std::vector<int>*)
make: *** [game/BonusManager.o] Error 1


And, by the way:
I don't know when I can get 2.8.3 PhysX SDK. I don't want to register at nVidia as «Registered PhysX developer» and I angry about nVidia's behavior about it and this stupid restriction. But I've found a direct download link to download 2.8.1.deb.tar.gz from developer.download.nvidia.com. ;) Unfortunately, replacing 2.8.1 to 2.8.3 in both places in link didn't help to download 2.8.3 and throws 404. So, nVidia is very bad guys at this point ;)

mva
Posts: 10
Joined: Thu Apr 05, 2012 9:49 am
Location: Russia, Tomsk and Moscow
Contact:

Re: errors compiling code on Linux

Postby mva » Mon Apr 30, 2012 8:44 pm

anybody alive? ;)


Return to “Jack Claw Feedback & Development”

Who is online

Users browsing this forum: No registered users and 4 guests