LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2017, 06:00 PM   #1
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 573

Rep: Reputation: 36
compilation error in defendguin warning: implicit declaration of function


Hello,

I am unable to compile defendguin. I copied the sdl library, but it was missing the sdl_mixer.h file. I found the mixer source code and saved it as sdl_mixer.h. I did some research and found that the error is because the compiler has not seen a declaration (prototype) yet. I feel that it can be make to compile, but I am unfamiliar with c. When I run make, the following occurs:

jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> make
make: sdl-config: Command not found
make: sdl-config: Command not found
cc -Wall -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES src/defendguin.c -c -o obj/defendguin.o
src/defendguin.c: In function ‘game’:
src/defendguin.c:781:3: error: unknown type name ‘SDLKey’
SDLKey key;
^
src/defendguin.c:890:9: error: ‘SDLK_LAST’ undeclared (first use in this function)
key = SDLK_LAST;
^
src/defendguin.c:890:9: note: each undeclared identifier is reported only once for each function it appears in
src/defendguin.c:3657:7: warning: implicit declaration of function ‘SDL_Flip’ [-Wimplicit-function-declaration]
SDL_Flip(screen);
^
src/defendguin.c: In function ‘option_screen’:
src/defendguin.c:3721:3: error: unknown type name ‘SDLKey’
SDLKey key;
^
src/defendguin.c: In function ‘title’:
src/defendguin.c:3996:3: error: unknown type name ‘SDLKey’
SDLKey key;
^
src/defendguin.c: In function ‘setup’:
src/defendguin.c:4331:29: error: ‘SDL_FULLSCREEN’ undeclared (first use in this function)
screen = set_vid_mode(SDL_FULLSCREEN);
^
src/defendguin.c:4455:3: warning: implicit declaration of function ‘SDL_WM_SetCaption’ [-Wimplicit-function-declaration]
SDL_WM_SetCaption("Defendguin", "Defendguin");
^
src/defendguin.c:4480:7: warning: implicit declaration of function ‘SDL_DisplayFormat’ [-Wimplicit-function-declaration]
images[i] = SDL_DisplayFormat(image);
^
src/defendguin.c:4480:17: warning: assignment makes pointer from integer without a cast [enabled by default]
images[i] = SDL_DisplayFormat(image);
^
src/defendguin.c:4496:36: error: ‘SDL_SRCCOLORKEY’ undeclared (first use in this function)
if (SDL_SetColorKey(images[i], (SDL_SRCCOLORKEY | SDL_RLEACCEL),
^
src/defendguin.c:4515:4: warning: implicit declaration of function ‘SDL_UpdateRect’ [-Wimplicit-function-declaration]
SDL_UpdateRect(screen, 0, 0, 640, 480);
^
src/defendguin.c: In function ‘set_vid_mode’:
src/defendguin.c:4778:3: warning: implicit declaration of function ‘SDL_VideoModeOK’ [-Wimplicit-function-declaration]
depth = SDL_VideoModeOK(640, 480, 16, flags);
^
src/defendguin.c:4779:3: warning: implicit declaration of function ‘SDL_SetVideoMode’ [-Wimplicit-function-declaration]
return depth ? SDL_SetVideoMode(640, 480, depth, flags) : NULL;
^
src/defendguin.c:4779:59: warning: pointer/integer type mismatch in conditional expression [enabled by default]
return depth ? SDL_SetVideoMode(640, 480, depth, flags) : NULL;
^
src/defendguin.c: In function ‘pause_screen’:
src/defendguin.c:5574:14: warning: assignment makes pointer from integer without a cast [enabled by default]
old_screen = SDL_DisplayFormat(screen);
^
make: *** [obj/defendguin.o] Error 1
 
Old 07-29-2017, 07:43 PM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 664

Rep: Reputation: 190Reputation: 190
What distro are you on? The
Code:
make: sdl-config: Command not found
seems to be the relevant part here. You need the package providing that tool

Edit: if you are using dpkg/apt-get as your package manager, apt-file is a useful tool to have installed. You can search for what package has the tool you're looking for via something like
Code:
apt-file search sdl-config

Last edited by TheEzekielProject; 07-29-2017 at 07:49 PM.
 
Old 07-29-2017, 08:02 PM   #3
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Looks like you need to use the package manager for whichever distro you are running to download libsdl1.2 and libsdl1.2-dev.

The dev package contains, among other things, the header files and "sdl-config".

EDIT: Whoops. Had the page open in a tab and @TheEzekielProject beat me to it.

Last edited by norobro; 07-29-2017 at 08:04 PM.
 
Old 07-30-2017, 01:52 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
All of your distros appear old. You'll probably have problems getting newer software to work. If you try to piece the system together you'll wind up with frankenlinux.

Last edited by AwesomeMachine; 07-30-2017 at 01:53 PM.
 
1 members found this post helpful.
Old 07-31-2017, 10:45 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,429

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
A recent OS, example ...
1) The source code
http://cdn-fastly.deb.debian.org/deb...12.orig.tar.gz
2) The four patches
http://cdn-fastly.deb.debian.org/deb....debian.tar.xz

Code:
tar xvf defendguin_0.0.12.orig.tar.gz
cd defendguin_0.0.12/
tar xvf defendguin_0.0.12-6.debian.tar.xz
patch -p1 < debian/patches/0001_manpage
patch -p1 < debian/patches/0002_remove-l2r.sh
patch -p1 < debian/patches/codespell
patch -p1 < debian/patches/makefile
make
cc  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES  src/defendguin.c -c -o obj/defendguin.o
cc  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES obj/defendguin.o -o defendguin -L/usr/lib64 -lSDL -L/usr/X11R6/lib -lSDL_mixer -lm
# make install
... That's it : Two lines of "make".
SDL_mixer-devel is required: See defendguin-0.0.12/src/defendguin.spec
Requires: SDL >= 1.1
Requires: SDL_mixer >= 1.0


-

Last edited by knudfl; 07-31-2017 at 10:54 AM.
 
Old 08-02-2017, 06:26 PM   #6
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 573

Original Poster
Rep: Reputation: 36
I am using opensuse 13.1. Here is what I have installed:

(please note that where you see the blank tabs below, the line above fills the void, i.e. saves me typing.)

libSDL-1_2-0
-32bit
libSDL-2-2_0-0
-32bit
-tts-2_0-0
-Pangol
-gfx13
-image-1_2-0
-mixer-1_2-0
-net-1_2-0
-sound-1_0-1
-ttf-2_0-0
perl-Alien-SDL
perl-SDL

p.s.
after I post, I noticed the tab spaces go away so with lines starting with a "-", the line lib-SDL... fills the void.

Last edited by sirius57; 08-02-2017 at 06:30 PM.
 
Old 08-03-2017, 11:44 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,429

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Re #6.

Missing :

# zypper in libSDL-devel libSDL2_mixer-devel

I.e. when building/compiling applications the requirements are [(lib)Name]-devel

-
 
Old 08-05-2017, 07:26 PM   #8
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 573

Original Poster
Rep: Reputation: 36
I installed the ibSDL_mixer-devel and it also wanted my opensuse 13.1 install disk to copy several dependency files. I was able to run make, but it did not install. I have a copy/paste of my shell:

jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> make
cc -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES src/defendguin.c -c -o obj/defendguin.o
cc -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES obj/defendguin.o -o defendguin -L/usr/lib64 -lSDL -lpthread -L/usr/X11R6/lib -lSDL_mixer -lm
jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> make install
install -d /usr/local/share/defendguin/
install: cannot change permissions of ‘/usr/local/share/defendguin/’: No such file or directory
make: *** [install] Error 1
jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> defendguin
If 'defendguin' is not a typo you can use command-not-found to lookup the package that contains it, like this:
cnf defendguin
jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> cnf defendguin
defendguin: command not found
jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12>


defendguin is not in /usr/local/share/defendguin/ however, it is in the folder /Downloads/defendguin-0.0.12 where it was compiled.
 
Old 08-06-2017, 08:01 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,429

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
Quote:
jeffrey@linux-9u2x:~/Downloads/defendguin-0.0.12> make install
! Wrong command ! 'make install' must be run as root :

1) su
2) enter root password.
3) make install
4) exit
 
Old 08-07-2017, 04:42 PM   #10
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 573

Original Poster
Rep: Reputation: 36
Thank you! That was it. Ran make install in a root terminal and the game played very well.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
warning: incompatible implicit declaration of built-in function ‘bzero’ nasim751 Linux - Software 3 04-21-2014 03:39 AM
warning: implicit declaration of function liguorir Linux - Software 5 10-22-2012 03:20 PM
warning: implicit declaration of function `snprintf' BiThian Programming 13 10-06-2011 04:26 PM
warning: implicit declaration of function bhagavath812anish Programming 1 12-02-2010 02:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration