reinstalling sdl manually on buntu - sdl

I am new to doing manually installing.
I reinstalled sdl manually, now everytime I run pygame or a game that uses SDL (eg. solarwolf or supertux) I get the message: Unsupported console hardware.
I know my computer can run SDL, because it worked prior to the reinstallation.
I want to now how I can reinstall SDL properly, so that pygame will work again.
versions:
ubuntu: Ubuntu 10.04 LTS Lucid Lynx
sdl: 1.2.14
Stuff I have tried:
1)
I have tried this commandoes I found on the net:
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar -xzvf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure --prefix=$HOME
make
make install
2)
I tried again with sudo and no prefix. Maybe that wrecked some prior configurationsfile or something?
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar -xzvf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure
make
sudo make install
3)I used the Synaptic Package Manager to completely remove and reinstall all files starting with libsdl.
4)I have tried reinstalling supertux and solarwolf (with ubuntu software senter)
hoping it could resolve the problem if there were some missing dependencies.
Conclusion. I geuss a have installed sdl, but wrecked a confirgurationfile or something preventing communication between sdl and the graphic driver.
But that is a wild guess.

This sounds strange.
try: sudo ldconfig
from man ldconfig
"ldconfig creates, updates, and removes the necessary links and cache
(for use by the run-time linker, ld.so) to the most recent shared
libraries found in the directories specified on the command line, in
the file /etc/ld.so.conf, and in the trusted directories (/usr/lib and
/lib). ldconfig checks the header and file names of the libraries it
encounters when determining which versions should have their links
updated. ldconfig ignores symbolic links when scanning for libraries.
"

Related

How to install libpq-fe.h?

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

Issue using libsdl2-image-2.0-0

Recently I've been playing around with the SDL library and wanted to start using libsdl2-image-2.0-0 along with SDL. I have been trying to get this working with Ubuntu 15.04. I have installed the package using
sudo apt-get install libsdl2-image-2.0-0
The installation appeared to go completely fine but when I try to include the image library in my C++ code with
#include <SDL2/SDL_image.h>
I get an error "fatal error: SDL2/SDL_image.h: No such file or directory"
I went and looked where the SDL2 base library was located /usr/local/include/SDL2 and just as the error message said SDL_image.h was not there.
I then tried to figure out where the library was using
apt-file search SDL_image.h
When I do this
libsdl-image1.2-dev: /usr/include/SDL/SDL_image.h
libsdl2-image-dev: /usr/include/SDL2/SDL_image.h
both show up as results. This is strange to me since I did not install libsdl2-image-dev. Also when I try to view /usr/include/SDL2/ the folder doesn't even appear to exist which just adds to my confusion.
I then tried to remove libsdl2-image-dev so I could install libsdl2-image-2.0-0 but when I run the command
sudo apt-get remove libsdl2-image-dev
I get
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'libsdl2-image-dev' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
and when I try to run the command
sudo apt-get install libsdl2-2.0-0
I end up getting
Reading package lists... Done
Building dependency tree
Reading state information... Done
libsdl2-2.0-0 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
So basically I cannot locate where this library is and so I can't properly link it to my code. Is there a more reliable way to locate where this library is and is there something fundamental I am not understanding in regards to using these supplementary libraries?
You need the development packages installed to develop SDL2 based programs.
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-image-dev

Unable to locate package GLFW on Linux Mint

I have been trying to install GLFW and GLFW3, using Terminal to install
sudo apt-get install GLFW
sudo apt-get install GLFW3
Whenever I do so, I get results such as
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package glfw3
I have been trying to install GLFW for two hours now, and I'm getting a bit impatient. Also I'm very new to Linux (Mint), so I apologize if I'm doing something stupid...
EDIT:
No matter what I try, my program encounters
/home/myusername/Desktop/basic_window.cpp:11:21: fatal error: GL/glfw.h: No such file or directory
#include <GL/glfw.h>
^
compilation terminated.
Having a frustrating time with this, not sure why this is much more complicated than the other libraries I've installed so far.
I have been trying to install GLFW and GLFW3, using Terminal to install...
On Mint 17, it looks like you need to install libglfw2. So perform a sudo apt-get install libglfw2.
If you plan on developing against it, then install libglfw-dev instead. Notice the lack of a version number.
If interested, perform apt-cache search glfw
In Debian-based systems such as Ubuntu and Mint, library packages typically have names that begin with "lib", and development headers (for compiling new programs that use the library) are in a separate package whose name ends with "-dev".
Ubuntu 14.04 has GLFW 2 packaged as libglfw2 and libglfw-dev. Mint doesn't seem to have those packages, but you can probably use the Ubuntu ones since Mint 17 is based on Ubuntu 14.04.
GLFW 3 isn't in Ubuntu 14.04, but it looks like it'll be in 14.10 (as libglfw3 and libglfw3-dev).
Unless you really need GLFW 3 specifically, you're probably better off sticking with the packaged GLFW 2. Packages get easy automatic upgrades; compiling stuff "by hand" is a good way to end up with lots of cruft in your system with no automatic upgrade or uninstall.
Download GLFW source packages from their website.
Extract the folder glfw-3.0.4 from the tarball
Open console
Navigate to the folder you just extracted and go inside of it using cd
Type cmake . (be sure you include the dot)
If cmake . fails, then type the following as root:
apt-get install cmake
If you don't think you're root then type the following:
sudo apt-get install cmake
If that doesn't work then type the following as root, or add sudo if you're not root:
apt-get install build-essential cmake
Once you have cmake installed, navigate back to the folder and try cmake . again.

Failed to compile wxWidgets-2.9.2 on Kubuntu11.10(64bit) with '--with-opengl' flag

I tried to compile wxWidgets-2.9.2 with opengl support by calling
configure --with-opengl
But it failed when the configure script tried to locate the lib files of opengl
checking for GL/gl.h... yes
checking for GL/glu.h... yes
checking for -lGL... no
checking for -lMesaGL... no
configure: error: OpenGL libraries not available
However, I checked /usr/lib and found that there is libGL.so in that directory. Actually, before trying to compile wxWidgets-2.9.2, I had written several opengl programs and all were successfully compiled and run. Could someone help me to fix this?
This is actually a bug in the configure script, please see
http://trac.wxwidgets.org/ticket/13375.
The solution is to download the latest codes from
http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk/
Or you can select to overwrite only the configure,acinclude.m4 files.
Have you tried installing the free implementation?
sudo apt-get install libglw1-mesa libglw1-mesa-dev
Are you running proprietary drivers from Nvidia or something? I think it messes around with the OpenGL environment while installing. Perhaps, it is worth trying to go back the the opensource ones if this is the case.
There is also a know issue OpenGL libs not located by 'configure' in debian testing
First of all check if opengl libs are installed! them --->
we need to change Configure file on source! check this link:
http://trac.wxwidgets.org/ticket/13376
the same issues arise on ubuntu 12.04!
I also met the same problem when trying to compile wxWidgets3.1.0 --with-opengl on Debian Jessie x86_64. I tried
SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s#include#$wx_cv_std_libpath#g` /usr/$
wx_cv_std_libpath /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu"
and
pkg-config --variable=libdir gl
/usr/lib/x86_64-linux-gnu
and
sudo apt-get install libglw1-mesa libglw1-mesa-dev
but:
OpenGL libraries not available
I then tried
sudo apt-get install glutg3-dev
but:
glutg3-dev is not found.
So I searched for the alternative to glutg3-dev in Jessie and I tried
sudo apt-get install freeglut3-dev
then it worked!
Installing mesa didn't help for me, but installing glutg3-dev did the trick
sudo apt-get install glutg3-dev

Enabling OpenGL in wxWidgets

I installed the wxWidgets source code, compiled it and am linking the libraries thus obtained with my application code. Now I need to use OpenGL in my wxWidgets application. How do I enable this?
For building on Windows with project files:
Assume $(WXWIDGETSROOT) is the root directory of your wxWidgets installation.
Open the file $(WXWIDGETSROOT)\include\wx\msw\setup.h
Search for the #define for wxUSE_GLCANVAS.
Change its value from 0 to 1.
Recompile the library.
For building on Linux and other ./configure based platforms:
Just use ./configure --with-opengl
(A mashup answer from two partial answers given by others)
If you're using configure to build wxWidgets you just need to add --with-opengl to your command line.
Just to add a little bit... If you're on linux you need to watch the logs when running configure. If it can't find opengl dev packages then it will turn opengl off with one line of warning which is easy to miss.
run it like this to make it more obvious what development libraries you're actually missing (it looks like the --with-opengl is on by default in 3.0.0 and possibly earlier versions of wxwidgets, but it can't hurt to include it I suspect).
./configure --with-opengl > configure.log
Once configure can find all the dev libs you think you're going to use you need to rebuild wxwidgets:
make
sudo make install
I had to install these on linux mint to make wxwidget's configure happy as far as opengl was concerned (and should also work for ubuntu) to get the dev libs I needed.
sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev
(Assume $(WX_WIDGETS_ROOT) is the root directory of your wxWidgets installation.)
Open the file $(WX_WIDGETS_ROOT)\include\wx\msw\setup.h
Search and find the option wxUSE_GLCANVAS. Change its value from 0 to 1.
Recompile the library.