Library <graphics.h> is missing for MinGW-W64 - c

Compiler: MinGW-W64 GCC-8.1.0 (x86_64-posix-seh)
Missing library: graphics.h
It seems like this library was not installed by default. If such case is true, where can I get it?
As a side note, I am not interested in installing a full IDE like Visual Studio just to use this one library.

After looking into this for 5 minutes, I think you will need to install either sdl-bgi or WinBGIm. Since MSYS2 doesn't seem to have packages for these, you would need to compile those projects from source. This means you would need to figure out the correct set of configuration optiosn and possibly fix any build errors. If you do succeed in doing that, you might consider contributing your work as an MSYS2 package so others can benefit from it ( https://github.com/Alexpux/MINGW-packages ).

Related

What settings to use when installing MinGW-W64 to build FuTTY?

I want to build FuTTY.
The original author uses Visual Studio, I want to avoid that. I found out that apparently I have to:
Add MinGW/bin and MinGW/msys/1.0/bin to the PATH
run perl mkfiles.plto restore some missing makefiles
Remove -mno-cygwin from Makefile.cyg
Add XFLAGS = -DCOVERITY to Makefile.cyg
run make -f Makefile.cyg putty.exe from the windows directory
This works for building the original PuTTY, but is not enough for FuTTY.
It complains that KEY_WOW64_32KEY is undeclared. When I googled that, I found that apparently this means you need MinGW-W64.
At this point I'm making wild guesses, but I think the selector shown below means that the MinGW-W64 project is about making all kinds of toolchains run on Windows 64 bit and if I want something that works with PuTTY's MinGW makefile, I need this:
Right? So after downloading that, I am presented with questions I cannot answer:
I'm using more handy tool chain distribution MSYS2

cmake install multiple version of the same library

I am trying to have a scheme with my library that is coherent and usable/reusable.
I work in a team where we work with continuous integration but sometimes I need to use old version of the same library. That's because some part of the software are not updated for using the new version.
I'm actually in the middle of a headache understanding how to use cmake for having something like this:
PATH/Library/Processor/Library_X/Version/static_library_and_includes
Where Library is a common name where to put my stuff
Processor could be attiny24, atmega, lxpXXXX, etc
Library_X is the name of the library
Version a progressive number from 0 to X
static_library_and_includes the static libraries built within that cmake module and the include files needed for using it.
How can I do this using cmake?
I work with different microprocessor crosscompiling with gcc. This is not a problem.
I work with static library, this is not a problem.
I can install them in the right directory. Not a problem
I can't ask the executable to link to the right .a file. Sometimes cmake pick the right one, sometimes not.
Can you please give me a hint on how you guys do it?
thank in advance
Andrea
See the search paths here: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure .
CMake will find packages in directories named name*, so you can install to <prefix>/FizzBuzz-1.0.0 and <prefix>/FizzBuzz-2.0.0.
As long as each as a correct ConfigVersion.cmake file, it should do what you want.

Clutter on OSX -- "Unable to find suitable GL visual" error

I am looking to try out clutter (http://www.clutter-project.org) on an OSX machine (10.6). I installed the toolkit first by setting up required dependencies via macports and then installing clutter from source (with needed osx flags).
When I try to compile any sample code, it succeeds. However, I always get a "ClutterGLX-CRITICAL **: Unable to find suitable GL visual." error.
I tried googling for answers but couldn't find anything useful.
Help!
Thanks.
I saw the same problem on my MacBook using the standard build from MacPorts, but the no_x11 variant worked okay for me. I am also using the universal variant because I'm using the library from a 32-bit app, so this is what my MacPorts command line looked like:
sudo port install clutter +universal +no_x11
You can probably omit the '+universal' if you only want the library built for your default architecture.

What is better downloading libraries from repositories of or installing from *.tar.gz

gcc 4.4.4 c89 Fedora 13
I am wondering what is better. To give you a compile of examples: apache runtime portable and log4c.
The apr version in my fedora repository is 1.3.9. The latest stable version on the apr website is 1.4.2.
Questions
Would it be better to download from the website and install, or install using yum?
When you install from yum sometimes it can put things in many directories. When installing from the tarball you can put the includes and libraries where you want.
The log4c the versions are the same, as this is an old project.
I downloaded log4c using yum. I copied all the includes and libraries to my development project directory.
i.e.
project_name/tools/log4c/inc
project_name/tools/log4c/libs
However, I noticed that I had to look for some headers in the /usr/include directory.
Many thanks for any suggestions,
If the version in your distribution's package repository is recent enough, just use that.
Advantages are automatic updates via your distribution, easy and fast installs (including the automatic fetching and installing of dependencies!) and easy removals of packages.
If you install stuff from .tar.gz by yourself, you have to play your own distribution - keep track of security issues and bugs.
Using distribution packages, you have an eye on security problems as well, but a lot work does the distributor for you (like developing patches, repackaging, testing and catching serious stuff). Of course each distributor has a policy how to deal with different classes of issues for different package repositories. But with your own .tar.gz installs you have nothing of this.
It's an age-old question I think. And it's the same on all Linux distributions.
The package is created by someone - that person has an opinion as to where stuff should go. You may not agree - but by using a package you are spared chasing down all the dependencies needed to compile and install the software.
So for full control: roll your own - but be prepared for the possible work
otherwise use the package.
My view:
Use packages until it's impossible to do so (conflicts, compile parameters needed, ..) . I'd much rather spend time getting the software to work for me, than spend time compiling.
I usually use the packages provided by my distribution, if they are of a new enough version. There is two reasons for that:
1) Someone will make sure that I get new packages if security vulnerabilities in the old ones are uncovered.
2) It saves me time.
When I set up a development project, I never create my own include/lib directories unless the project itself is the authorative source for the relevant files I put there.
I use pkg-config to provide the location of necessary libraries and include files to my compiler. pkg-config use some .pc-files as a source of information about where things are supposed to be, and these are maintained by the same people who create the packages for your distribution. Some libraries does not provide this file, but an alternative '-config'-script. I'll provide two examples:
I'm not running Fedora 13, but an example on Ubuntu 10.04 would be;
*) Install liblog4c-dev
*) The command "log4c-config --libs" returns "-L/usr/lib -llog4c" ...
*) The command "log4c-config --cflags" returns "-I/usr/include"
And for an example using pkg-config (I'll use SDL for the example):
*) Install libsdl1.2-dev
*) The command "pkg-config sdl --libs" returns "-lSDL"
*) The command "pkg-config sdl --cflags" returns "-D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL"
... So even if another distribution decides to put things in different paths, there are scripts that are supposed to give you a reliable answer to where things is - so things can be built on most distributions. Autotools (automake, autoconf, and the likes) amd cmake are quite helpful to make sure that you don't have to deal with these problems.
If you want to build something that has to work with the Apache that's included with Fedora, then it's probably best to use the apr version in Fedora. That way you get automatic security updates etc. If you want to develop something new yourself, it might be useful to track upstream instead.
Also, normally the headers that your distro provides should be found by gcc & co. without you needing to copy them, so it doesn't matter where they are stored by yum/rpm.

MSVCR90.DLL was not found

I know a question like this was already asked, but the situation is a little different, and all the answers on that problem didn't work for me.
I'm trying to compile some C code in VS2008 and it doesn't create an exe. Also, when I try to run it with f5, I get:
This application has failed to start
because MSVCR90.DLL was not found.
I did some googling and it said that this was because my c++ redistributable package wasnt installed. So I installed that, restarted everything and tried again. But alas, I still get the same error. Does anyone have any clue how to fix this?
It sounds like either a problem with your VS2008 installation, or something wrong with your DLL search path. MSVCR90.DLL is installed when you install VS2008, you shouldn't have to install any additional redistributable packages.
First I would check your PATH environment variable and make sure there is no gobbledydook in it that will break some of the entries, and if you don't find a problem there, then I would uninstall and reinstall Visual Studio.
You could also try searching for MSVCR90.DLL (and other DLLs like it), and move them to your Windows/System32 folder.
If you just want to get going now, another thing you could do is change your project to statically link to the runtime libraries, and then it wont even try to load that DLL. Go to your Project settings, Configuration Properties->C/C++->Code Generation and change Runtime Library from Multi-Threaded DLL to just Multi-Threaded (or any of the options that doesn't end with DLL).
Here are some things to check for your configuration of the project- under the general tab:
.1 Configuration type - exe in your case.
.2 Use of MFC: if this is an MFC application it might be more portable if you do: Use MFC in a static library.
.3 Use of ATL - if not using atl (or not sure) say Not using ATL.
.4 Under C/C++ -> Runtime Library: Say Multi-threaded Debug (for debug version) or Multi-Threaded (for release version).
If you are getting specific linker errors that say something is already defined:
This means that you have some parts of your app (separate libs being linked to your exe) that are built with different runtime linking:
You can:
Make sure that these libraries were compiled with the same version of visual studio as your application.
Change those projects to use static runtime: C/C++ -> Code Generation -> Runtime LIbrary: /MT or MTd (same as #4 above)
If you still have some specific errors try telling the linker to ignore certain libraries: Go to Linker->Ignore Specific Library and put in the library that you want to ignore. This is most common for 'libcmt.lib' or 'libcmtd.lib'. It is important also to know that lib ending with 'd' is usually the debug version. If you are creating a release build and you are getting 'already defined in libcmtd.lib' that means that somewhere you are linking a release lib to a debug lib.
if you delete the manifest file associated with you .exe, you will get the same error.
MSVCR90.dll is not installed in system32, but in the side-by-side folder, hence the manifest is required.
I have just been bitten by this and this page got me working again.
The key is to ignore MSVCRT and MSVCR90 libraries for the debug configuration. Set your linker -> Input -> Ignore Specific Library setting to include the following:
MSVCRT
MSVCR90
it is supposedly in the http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displaylang=en visual studio 2008 runtime library. Yes! After installing that, openoffice update works.
If you give the finished exe to someone else they will need to install the latest visual c runtime to run it. This will only work for release build AFAIK. Visual studio should install the required runtime both release and debug into your path. The project probably has an additional dependency accidently set for an incorrect version of the runtime.
See if this page helps.
Go to your Project settings, Configuration Properties->C/C++->Code Generation and change Runtime Library from Multi-Threaded DLL to Multi-Threaded and then try to compile but it won't. Then change it to Multi-Threaded Debug and try to compile ,but it won't again and then you change it back to Multi-Threaded DLL and then it should compile and run.

Resources