Allacrost 0.1.0 linking issues during make.

For those having trouble installing/running the game or to report a bug

Moderator: Staff

User avatar
Platyna
Newbie
Posts: 8
Joined: Sat Oct 21, 2006 5:13 pm
Location: Poland
Contact:

Allacrost 0.1.0 linking issues during make.

Postby Platyna » Sat Oct 21, 2006 5:51 pm

Problem Type
Compiling.

Frequency of Problem Occurence
Always.

Operating System
Slackware 11.0
Linux boadicea 2.6.18 #6 SMP PREEMPT Thu Oct 12 20:37:45 CEST 2006 i686 i686 i386 GNU/Linux

Problem Description
Linking error during make as follows:

Code: Select all

make[1]: Entering directory `/home/platyna/allacrost-0.1.0'
g++  -Wall -O3   -L/usr/X11R6/lib -o allacrost  main.o main_options.o utils.o system.o input.o mode_manager.o data.o global.o audio.o audio_sound.o audio_music.o draw.o effects.o fade.o gui.o image.o interpolator.o menu_window.o option.o particle_effect.o particle_manager.o particle_system.o shake.o tex_mgmt.o text.o textbox.o video.o battle.o battle_actors.o boot.o boot_menu.o boot_credits.o map.o map_actions.o map_dialogue.o map_objects.o menu.o menu_views.o pause.o quit.o scene.o  -lm -llualib -llua -lSDL_ttf -lSDL_mixer -lSDL -ljpeg -lpng -lGLU -lGL
tex_mgmt.o(.text+0x1442): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
tex_mgmt.o(.text+0x145e): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned int)'
tex_mgmt.o(.text+0x1473): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _IO_FILE*)'
tex_mgmt.o(.text+0x147d): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)'
tex_mgmt.o(.text+0x1485): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)'
tex_mgmt.o(.text+0x1522): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned int)'
tex_mgmt.o(.text+0x1649): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)'
tex_mgmt.o(.text+0x1651): In function `hoa_video::GameVideo::_LoadRawImageJpeg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, hoa_video::private_video::ImageLoadInfo&, bool)':
: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
video.o(.text+0x24b): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
video.o(.text+0x267): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_CreateCompress(jpeg_compress_struct*, int, unsigned int)'
video.o(.text+0x29f): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_stdio_dest(jpeg_compress_struct*, _IO_FILE*)'
video.o(.text+0x2d3): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_set_defaults(jpeg_compress_struct*)'
video.o(.text+0x2e6): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_set_quality(jpeg_compress_struct*, int, int)'
video.o(.text+0x2f6): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_start_compress(jpeg_compress_struct*, int)'
video.o(.text+0x34a): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_write_scanlines(jpeg_compress_struct*, unsigned char**, unsigned int)'
video.o(.text+0x352): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_finish_compress(jpeg_compress_struct*)'
video.o(.text+0x36d): In function `hoa_video::GameVideo::MakeScreenshot()':
: undefined reference to `jpeg_destroy_compress(jpeg_compress_struct*)'
collect2: ld returned 1 exit status
make[1]: *** [allacrost] Error 1
make[1]: Leaving directory `/home/platyna/allacrost-0.1.0'
make: *** [all] Error 2


Maybe it is somehow related to configure script being unable to detect -lGLU without specified CXXFLAGS and LDFLAGS variables before configure.

Additional Notes
allacrost version 0.1.0
gcc version 3.4.6
x11 version 6.9.0
openal version 0.0.8
lua version 5.0.3
devil version 1.6.8rc2
libogg version 1.1.3
libvorbis version 1.1.2
sdl version 1.2.11
sdl_ttf version 2.0.8

Allacrost configure command:

Code: Select all

CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" CXXFLAGS="$CXXFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib" ./configure --prefix=/usr --sysconfdir=/etc


Regards.
Zuzanna K. Filutowska
Forum about RPG/misc: http://forum.elite.t28.net/
What does not destroy me, makes me stronger. -- F. Nietzsche
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Postby gorzuate » Sat Oct 21, 2006 6:31 pm

Do you have libjpeg and libpng installed?
Image
User avatar
Platyna
Newbie
Posts: 8
Joined: Sat Oct 21, 2006 5:13 pm
Location: Poland
Contact:

Postby Platyna » Sat Oct 21, 2006 6:41 pm

Yes, libjpeg 6b and libpng 1.2.12. Everything related to the processing of these file formats works correctly on my system.

Regards.
Zuzanna K. Filutowska

Forum about RPG/misc: http://forum.elite.t28.net/

What does not destroy me, makes me stronger. -- F. Nietzsche
User avatar
Roots
Dictator
Posts: 8666
Joined: Wed Jun 16, 2004 6:07 pm
Location: Austin TX
Contact:

Postby Roots » Sat Oct 21, 2006 6:47 pm

That's odd. The linking errors are definitely because it's not finding the libjpeg library. Perhaps Slackware installs libjpeg into a location that isn't on your library path? :shrug:
Image
User avatar
Platyna
Newbie
Posts: 8
Joined: Sat Oct 21, 2006 5:13 pm
Location: Poland
Contact:

Postby Platyna » Sat Oct 21, 2006 7:13 pm

Then it wouldn't detect libjpeg during configure, but it does. And Slackware installs libjpeg in /usr which is standard location according to FHS. Here is the list of all installed files:

Code: Select all

./
usr/
usr/bin/
usr/bin/cjpeg
usr/bin/djpeg
usr/bin/jpegtran
usr/bin/rdjpgcom
usr/bin/wrjpgcom
usr/doc/
usr/doc/libjpeg-6b/
usr/doc/libjpeg-6b/coderules.doc
usr/doc/libjpeg-6b/install.doc
usr/doc/libjpeg-6b/usage.doc
usr/doc/libjpeg-6b/README
usr/doc/libjpeg-6b/filelist.doc
usr/doc/libjpeg-6b/libjpeg.doc
usr/doc/libjpeg-6b/structure.doc
usr/doc/libjpeg-6b/wizard.doc
usr/doc/libjpeg-6b/jconfig.doc
usr/lib/
usr/lib/libjpeg.a
usr/lib/libjpeg.so.62.0.0
usr/man/
usr/man/man1/
usr/man/man1/wrjpgcom.1.gz
usr/man/man1/jpegtran.1.gz
usr/man/man1/cjpeg.1.gz
usr/man/man1/djpeg.1.gz
usr/man/man1/rdjpgcom.1.gz
usr/include/
usr/include/jerror.h
usr/include/jconfig.h
usr/include/jmorecfg.h
usr/include/jpeglib.h
install/
install/doinst.sh
install/slack-desc


I have checked if my libjpeg has all these symbols, and it does, so I dare to say your configure and/or Makefiles are broken.

Regards.
Zuzanna K. Filutowska

Forum about RPG/misc: http://forum.elite.t28.net/

What does not destroy me, makes me stronger. -- F. Nietzsche
User avatar
gorzuate
Developer
Posts: 2575
Joined: Thu Jun 17, 2004 3:03 am
Location: Hermosa Beach, CA
Contact:

Postby gorzuate » Sat Oct 21, 2006 8:03 pm

We don't use DevIL any more. I don't see how configure and Make can be broken if they're detecting the libraries installed in the correct places... :huh:
Image
User avatar
Platyna
Newbie
Posts: 8
Joined: Sat Oct 21, 2006 5:13 pm
Location: Poland
Contact:

Postby Platyna » Sat Oct 21, 2006 8:10 pm

SOLUTION:
Here is a patch which fixes the issue in /usr/include/jmorecfg.h.

Code: Select all

--- jmorecfg.h  2006-10-21 21:50:42.000000000 +0200
+++ jmorecfg.h  2006-10-21 21:48:30.000000000 +0200
@@ -186,9 +186,12 @@
 #define LOCAL(type)            static type
 /* a function referenced thru EXTERNs: */
 #define GLOBAL(type)           type
-/* a reference to a GLOBAL function: */
-#define EXTERN(type)           extern type

+#ifdef __cplusplus
+#define EXTERN(type)           extern "C" type
+#else
+#define EXTERN(type)           extern type
+#endif

 /* This macro is used to declare a "method", that is, a function pointer.
  * We want to supply prototype parameters if the compiler can cope.


I didn't wrote it, I just fixed a patch written by Craig Rodrigues for FBSD 7.0.

Anyway you still should take a look in your configure scripts, they are obviously ignoring options such as --x-includes=DIR and --x-libraries=DIR, does not find GLU libraries in quite common location (/usr/X11/lib) and gives ./configure: line 5468: --include: command not found error.
Also the default location for data files should be, according to FHS $PREFIX/share/program_name or $PREFIX/share/program_name-version or in $PREFIX/games eg. $PREFIX/share/allacrost-0.1.0.

About devIL, I took depencies list from your Wiki and installed them all, so if it outdated list, update it. ;)

Regards.
Zuzanna K. Filutowska

Forum about RPG/misc: http://forum.elite.t28.net/

What does not destroy me, makes me stronger. -- F. Nietzsche
Guest

Postby Guest » Mon Nov 27, 2006 12:05 pm

I had the same problem with jpeg. The problem is that the jpeg definition is not appropriate when using C++.
Try

extern "C" {
#include <jpeglib.h>
}

Return to “Technical Issues”

Who is online

Users browsing this forum: No registered users and 1 guest