![]() |
|
/usr/bin/ld: cannot find -lalleg.so |
AceBlkwell
Member #13,038
July 2011
![]() |
Does anyone know how to fix this? I've tried updating /etc/ld.so.conf to include the library file location but it didn't change anything. I also put the location in the IDE which is how I normally include library files. In any case I'm not having any luck. I installed allegro 4.4 is it possible its looking at the Allegro 5 file of the same name and balking at it? Thanks Invoking: GCC C++ Linker |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
I don't think that's quite the right name for the .so file Ace My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AceBlkwell
Member #13,038
July 2011
![]() |
Thanks Edgar. I'm still confused however. (See the included picture) The liballeg.so file is available (in red) . This is the setup I had in the IDE from my previous computer. It compiled fine then. However I was static linking then and this time, I removed the XXXXXX.a file from the list along with commenting out the STATICLINK lines in the program. In any case, I tried liballegro.so file,(in yellow). It didn't change anything. Sounds like I have a typo and I'm too close to see it. Let me know what you think. Thanks. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
EDIT That's the name for the static library. Either do it like before and static link, with ALLEGRO_STATICLINK defined, and link to the liballeg.a library. Or else link to liballeg44.so with -lalleg44 . That should be the proper name of the shared object library on linux. I can't remember and I don't have A4 installed on my VM at the moment. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AceBlkwell
Member #13,038
July 2011
![]() |
Ok I've tried compiling using a different IDE (Dev-C) and out of Windows. I'm not getting the usr/bin error of course but I'm getting a pc.h file not found. It's not on my system. It is being called by aldjgpp.h. Does any one know why I wouldn't have this file as part of the A4 package? Thanks. |
Dizzy Egg
Member #10,824
March 2009
![]() |
I'd imagine the DJGPP header is trying to call an old DOS header, which (unless you have an old Windows install!) probably doesn't exist anywhere?
---------------------------------------------------- |
AceBlkwell
Member #13,038
July 2011
![]() |
So pc.h isn't an Allegro file? |
DanielH
Member #934
January 2001
![]() |
Are you in Windows or Linux or DOS? You first post said .so files, which is Linux. Then you got Dev-CPP compiling in Windows, but using a DOS compiler. Windows no longer has DOS support. Not sure you can use DJGPP unless in a DOS emulator. If you're in Windows then and using Dev-CPP, then use MingW. MingW libraries end in .a by the way. |
AceBlkwell
Member #13,038
July 2011
![]() |
Daniel, I’m using Windows on the same computer with DEV-C / MingW I used when I originally wrote and compiled my game. The game was done a couple years ago. Over time I started using Eclipse and MingW. I wanted to double check something concerning A4 Fullscreen Vs Windowed. I tried to recompile the game using Kubuntu & Eclipse. I got the /usr/bin/ld: cannot find -lalleg.so: No such file or directory error. I decided to compile on the Win computer, Win 10 & Eclipse / MingW. I started getting the pc.h error. I went back to Dev-C/MingW, the original setup I used to create the Win version of the game but got the same pc.h error. I’m starting to think the issue is with my A4 installation. My Linux computer is new so it didn’t have A4 on it. I had to reinstall. Long story but Win computer no longer had A4 available either. I downloaded the A4 7Z file (for Win)and extracted it. I placed the folder in the appropriate location to be in the path. I did the same for Linux though using Linux compressed file. |
DanielH
Member #934
January 2001
![]() |
You're all over the place. Stick with one IDE like Dev-CPP or Eclipse and one compiler like MingW. Or don't use an IDE and use console. Do not use DJGPP in Windows compiling. The file that was missing pc.h is from DJGPP so you shouldn't even need that. I'm sure Edgar has Allegro 4 binaries for it. Or you could try compiling yourself. You would need to download cmake. I recently compiled allegro 4 for Visual Studios. It's not too difficult. MingW libraries have the format lib[name].a and you link -lname. So if the lib is name liballeg.a you link -lalleg. In Linux, you do use the .so file, but make sure the name is correct. Library files in linux usually contain the version in the name. It's been years since I've done any of that, so just going off the top of my noggin. |
AceBlkwell
Member #13,038
July 2011
![]() |
Thanks Daniel. Yeah, I am all over the map. In short I’ve always use Eclipse with Linux. For Windows, I’m using Portable Apps from a flash drive. I started a couple of years ago with Dev until I got Eclipse to work. At that time I was using Eclipse with both Win and Linux. Recently I tried to recompile an old game of mine. On Linux I got the “ld can’t find file” error. So I tried Win (with Eclipse) and got the pc.h file issue. I went to my original Win / Dev setup which the game was written & compiled from and got the same error. What is odd, I’m not using any weird libs or header files. Outside of some games specific headers. I’m only using allegro.h and liballeg (or alleg). The pc.h header file is called from the allegro.h file. Also I'm not intentionally using any DJGPP configuration. (Win) Even more strange, (Linux) running ld -L/usr/lib/x86_64-linux-gnu/ -lalleg.so --verbose sees the file and several associated files. In any case I’ll stumble across the answer eventually for one or the other. |
DanielH
Member #934
January 2001
![]() |
Sounds like the platform wasn't configured properly. That is done during compiling. Check alplat.h. What does it say? |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
Yeah, it sounds like you're trying to include headers from the source distribution, which won't work because they haven't been configured by cmake. What version of gcc are you using? Type gcc -v on Win and Linux and figure out the compiler version. This then has to match your binary distribution wherever you got it from. Yes, I do have A443 binaries for Windows if you're interested. They use the gcc 8.1 posix seh MinGW64 compiler. I can give you links to both if you choose. How did you install allegro on linux? Using your package manager? Or compiling from source? We'll straighten this out, don't worry. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AceBlkwell
Member #13,038
July 2011
![]() |
I’ve decided I may have some cproject file and or make file issue from copy/pasting work folders between the various OSs and IDEs. I know they aren't interchangeable but the game is a couple years old. I have 3-4 different folders for Rev levels and Win Vs Linux. I may have them mix and/or confused. So, I’m going to start a new project in Linux recreate each associated source and header files. I’ll use text editor to get the code and paste into the new project. I’ll let you know what happens. Edgar, I'll get the version numbers of both Linux and Win. As for installation, that's part of the problem, I didn't compile anything. I just unzip the Win version and stuck it in the path. For Linux I did do a sudo apt command to install libraries for Ubuntu. I'll keep you posted on the fresh tryout. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
First, liballeg.so is static on linux and windows. You generally don't compile statically on Linux. Use liballeg44.so instread. As for windows, which zip file for allegro did you get from where? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
DanielH
Member #934
January 2001
![]() |
Sound like you only downloaded the source code? Either compile it for your system or download pre-compiled binaries. They would have been configured specific to the system they were compiled for. |
AceBlkwell
Member #13,038
July 2011
![]() |
All, sorry for the wild goose chase. I found my final code for the game I wrote. I started a new program in the IDE and copy paste the text from the source code into the IDE files of the same name. I was able to compile and run it from Linux no problem. Basically, just a fresh start from scratch solved the Linux problem. I quickly did the same thing from Windows but still get the "can't find pc.h" error. I believe I need the binaries of Allegro to fix this issue. I'll work on get them. Thanks for all the help. |
DanielH
Member #934
January 2001
![]() |
The library download never contains binaries. You have to build the library or download the it from someone that compiled it. The default header files are not configured for Windows. That happens when the library is compiled. That is why you keep getting missing pc.h errors. pc.h is for DOS. |
Edgar Reynaldo
Major Reynaldo
May 2007
![]() |
My Allegro 443 binaries are on Bitbucket. And you can get the compiler I used on Sourceforge. Links below. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
AceBlkwell
Member #13,038
July 2011
![]() |
Thanks Edgar. I think you gave me a these few years ago, or something similar. I must have lost it in the shuffle to new computer and backup cleanup. ** UPDATE ** The missing binaries was the issue on Windows. The issue with "can't find pc.h" Thanks again Edgar. In short, no binaries was Win compiling problem and a mixture of IDE & Grabber file revision levels along with mixing IDE project files from Win and Linux was the Linux compiling issue. Maybe this will help someone. |
|