LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-03-2017, 04:37 PM   #1
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Rep: Reputation: 0
Question Allegro Library not detected by gcc


Installed Allegro Library 5.0
Slackware 13.37 (on old computer), running x windows

Everything seemed to be installed successfully, I followed all the compile instructions.
Tried to set the Allegro directory so it was in the path (detectable - previous advice from here). That didn't help either.

I load up my file in Emacs and hit compile, then type gcc myfile.c -save-temps -o myfile.exe

tell me where gcc libraries are kept, so I can manually copy the Allegro libraries into that directory? I don't even mind if I have to copy multiple files all over the place. Just want to be able to use Allegro.
 
Old 01-03-2017, 05:12 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570
Quote:
Originally Posted by AngryAngry View Post
I load up my file in Emacs and hit compile, then type gcc myfile.c -save-temps -o myfile.exe
Try modifying your compile command to:

Code:
gcc myfile.c -save-temps -o myfile.exe $(allegro-config --libs)
If that doesn't work, then you follow up with a copy-and-paste of what the output was. Not "it didn't work" or "that didn't help". Got that?

I assume you're continuing where you left off here, btw?

http://www.linuxquestions.org/questi...es-4175491443/

Last edited by dugan; 01-03-2017 at 05:20 PM.
 
1 members found this post helpful.
Old 01-03-2017, 05:56 PM   #3
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Original Poster
Rep: Reputation: 0
Thanks so much for the speedy reply.
Thanks for finding that old thread.

(from memory, the compiler says it can't find any of the allegro functions - lists them all, but I'll give you exact details of any problems)
 
Old 01-03-2017, 06:09 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570
Quote:
Originally Posted by AngryAngry View Post
(from memory, the compiler says it can't find any of the allegro functions - lists them all, but I'll give you exact details of any problems)
Try my suggestion first.
 
Old 01-03-2017, 10:34 PM   #5
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
In debian allegro has a pkg-config .pc file.

$ gcc file.c -o file.exe $(pkg-config --cflags --libs allegro)

Perhaps with -Wall -Wextra to help debug any quirks with the build. You might just be missing a -dev package, although I'm not sure if slackware breaks them up like that. Last time I used it, most everything was installed out of the box and I didn't need to seek things to compile any whims I had at the time. Outside of versioning issues anyway. As I recall using allegro to build a crude graphics editor on windows in the mid 90s with the help of djgpp.
 
Old 01-04-2017, 12:04 AM   #6
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Original Poster
Rep: Reputation: 0
Nope that did not work:

-*- mode: compilation; default-directory: "/root/" -*-
/bin/bash: allegro-config: command not found
/tmp/ccBLXcJN.o: In function 'main'
Myio.c;(.text+0xbe): undefined reference to 'Al_install_system'
Myio.c;(.text+0xbe): undefined reference to 'Al_install_keyboard'
Myio.c;(.text+0xbe): undefined reference to 'Al_create_timer'
Myio.c;(.text+0xbe): undefined reference to 'Al_create_display'
Myio.c;(.text+0xbe): undefined reference to 'Al_destroy_timer'

and repeat this for every function that is in Myio.c file.

Allegro directory at
/usr/local/include/Allegro5 - all the libraries look okay.
I'll try Shadows suggestion, now.

I tried to install VCL Media Player and it came up in my right click - to play open with VCL Media Player but it always failed - not sure if VCL just wouldn't work with slackware. Or perhaps there is something that I'm doing wrong with my installations.
Installation comes up as successful.
I just follow the install instructions, perhaps slackware needs another step that is common knowledge but I'm not aware of?

Last edited by AngryAngry; 01-04-2017 at 12:08 AM.
 
Old 01-04-2017, 02:33 AM   #7
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Original Poster
Rep: Reputation: 0
$ gcc file.c -o file.exe $(pkg-config --cflags --libs allegro)

Gave me this:

package allegro was not found on the pgk-config search path perhaps you should add the directory containing 'allegro.pc' to the PKG_CONFIG_PATH environment variable.
No package 'allegro' found.

the the regular allegro function list not found in my .c file


So how do I add directory to the PKG_CONFIG_PATH?
 
Old 01-04-2017, 03:20 AM   #8
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
If it's really PKG_CONFIG_PATH, then you can temp override it.

$ $(PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/ pkg-config --cflags --libs allegro-5.0)
-I/usr/include/x86_64-linux-gnu -lallegro

Which makes this gcc command:

$ gcc file.c -o file.exe $(pkg-config --cflags --libs allegro-5.0)

turn into this:

$ gcc file.c -o file.exe -I/usr/include/x86_64-linux-gnu -lallegro

Which might work for you completely ignoring the pkg-config or allegro-config options. Note that the .pc is allegro-5.0, not vanilla allegro which appears to be version 4's method. Tools like find are good for figuring this out. Or apt-file in debian for finding it out about packages not yet installed. YMMV
 
Old 01-04-2017, 10:19 AM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,985

Rep: Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570Reputation: 4570
Reinstall Allegro. This time use this:

https://www.slackbuilds.org/reposito...aries/allegro/

Yes it will work with 13.37.

Quote:
I tried to install VCL Media Player and it came up in my right click - to play open with VCL Media Player but it always failed - not sure if VCL just wouldn't work with slackware. Or perhaps there is something that I'm doing wrong with my installations.
Installation comes up as successful.
I just follow the install instructions, perhaps slackware needs another step that is common knowledge but I'm not aware of?
Quite possibly.

The way to install VLC is to download the package from here:

http://www.slackware.com/~alien/slackbuilds/vlc/pkg/

And then to install it with installpkg.

If you'd followed any other "instructions", they were wrong.

Last edited by dugan; 01-04-2017 at 12:14 PM.
 
1 members found this post helpful.
Old 01-04-2017, 03:02 PM   #10
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Original Poster
Rep: Reputation: 0
You might hate me for this. I didn't follow your instructions.
Because I was concerned about the x86_64 bit of your instruction - pretty sure my version is not 64bit - perhaps that has nothing to do with it and I'm stupid, tell me if that's the case.

HERE IS WHAT I DID:

Found:
usr/local/include/Allegro5 (all the libraries)

usr/share/gcc4.5.2 (copied all of /Allegro5 in here)

Found:
usr/local/lib/pkgconfig (FULL of allgero library files ending in .pc)

usr/lib/pkgconfig (copied all of those files into here GRRRRR!)

Compiled with this command
gcc Myio.c -o Myio.exe $(pkg-config --cflags --libs allegro5.0)

(no idea which thing I did worked, or if it was just the different compile line)
It worked PERFECTLY!

I'M TOTALLY OVER THE MOON NOW. Six months of this pathing bullshit, seriously WTF! Surely there is an easier way to get things in the path! A text configuration file I can edit?

Dungan:
I want Allegro 5 because there are significant changes between 4 & 5, so I'd rather learn 5. Thanks for your VLC tip, I'll go back and review that.

Last edited by AngryAngry; 01-04-2017 at 03:04 PM.
 
Old 01-04-2017, 06:16 PM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
That's what pkg-config is for, to return the "things" needed for "your" system. The x86_64 part was what it returned for "my" system. A hail mary in case all else failed.
 
Old 01-05-2017, 06:30 PM   #12
AngryAngry
Member
 
Registered: Jan 2011
Posts: 67

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Shadow_7 View Post
That's what pkg-config is for, to return the "things" needed for "your" system. The x86_64 part was what it returned for "my" system. A hail mary in case all else failed.
Yeah I figured that was the case with the _64 thing. Not saying anything bad against you.
I did look up how to use pkg-config, there was one bit that I found that stated I should
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/
But it was not clear if this would wreck my current paths.
I'll need to do more research on pkg, and start a different post to see if I'm understanding it.

I'm not too sure if copying all those files made any difference. Tried different compile lines (the original ones) and the compile failed. So perhaps it was just the new compile line you gave me lol

(sorry for being a bit frustrated - I'll put my frustration to better use in the future)
 
Old 01-05-2017, 11:57 PM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
That's what I love about debian. There's apt-file, so if your compile fails because it cannot find "a" file, install it. Try again, and add what you "need" as you need it. Versus other distros that are basically install "*" and it might work. I don't have that kind of bandwidth, or time. As I spent "ALL" of last weekend getting a windows 8.1 install last "used" in July of 2016 up to "date". And basically 3 days, 3 different ways of fixing windows update, and 5G's of "updates" later (windows offline update), and mission reluctantly accomplished. So I could take a typing test circa a web service whos min-req was NT4. So I could count smalls boxes inside a large box (warehouse) for a living.
 
  


Reply

Tags
gcc, libraries, programming language, slackware 13.37


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
Problems with allegro library packages ale_ryu Debian 3 02-26-2006 04:30 PM
Allegro game programming library on RH9 basix Red Hat 0 12-11-2003 11:29 AM
HELP!: installing Allegro library playmesumch00ns Programming 1 06-15-2001 02:47 PM
HELP!: installing Allegro library playmesumch00ns Linux - General 0 06-14-2001 02:53 PM
HELP!: installing Allegro library playmesumch00ns Linux - Software 0 06-14-2001 02:52 PM

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

All times are GMT -5. The time now is 08:59 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