Package vs Library

Imagine you want to use zlib in your project, you need to find the header file zlib.h, and the library libz.so (on Linux). You can use the low-level cmake commands find_path and find_library to find them, or you can use find_package(ZLIB). The later command will try to find out all what is necessary to use … Read more

libstdc++-6.dll not found

If you are using MingW to compile C++ code on Windows, you may like to add the options -static-libgcc and -static-libstdc++ to link the C and C++ standard libraries statically and thus remove the need to carry around any separate copies of those. Version management of libraries is a pain in Windows, so I’ve found … Read more

Get available modules

Type help() in the interpreter then To get a list of available modules, keywords, or topics, type “modules”, “keywords”, or “topics”. Each module also comes with a one-line summary of what it does; to list the modules whose summaries contain a given word such as “spam”, type “modules spam”. help> modules

Duplicate classes from androidx and com.android.support

Add these lines to your gradle.properties android.useAndroidX=true android.enableJetifier=true If gradle.properties is absent, create the file in the root directory of your project. It looks like you have some support relics anywhere in your dependencies, maybe from a lib? To investigate and see the dependencies tree, please run: ./gradlew :yourApp:dependencies and then you see from where … Read more

How to deal with symbol collisions between statically linked libraries?

At least in the case of static libraries you can work around it quite conveniently. Consider those headers of libraries foo and bar. For the sake of this tutorial I’ll also give you the source files examples/ex01/foo.h int spam(void); double eggs(void); examples/ex01/foo.c (this may be opaque/not available) int the_spams; double the_eggs; int spam() { return … Read more

How to add additional libraries to Visual Studio project?

For Visual Studio you’ll want to right click on your project in the solution explorer and then click on Properties. Next open Configuration Properties and then Linker. Now you want to add the folder you have the Allegro libraries in to Additional Library Directories, Linker -> Input you’ll add the actual library files under Additional … Read more