INSTALL_FAILED_MISSING_SHARED_LIBRARY error in Android

To get past INSTALL_FAILED_MISSING_SHARED_LIBRARY error with Google Maps for Android: Install Google map APIs. This can be done in Eclipse Windows/Android SDK and AVD Manager -> Available Packages -> Third Party Add-ons -> Google Inc. -> Google APIs by Google Inc., Android API X From command line create new AVD. This can be done by … Read more

python pip specify a library directory and an include directory

pip has a –global-option flag You can use it to pass additional flags to build_ext. For instance, to add a –library-dirs (-L) flag: pip install –global-option=build_ext –global-option=”-L/path/to/local” pyodbc gcc supports also environment variables: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html I couldn’t find any build_ext documentation, so here is the command line help Options for ‘build_ext’ command: –build-lib (-b) directory for … 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

How to create your own library for Android development to be used in every program you write?

You have to create Android Library Project. Create android project in Eclipse, enter Project Properties -> Android and check isLibrary property. Now you can add this library to your Android Application project by adding it to list on the same property page. More detailed instructions here in Working with Library Projects section

Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8′ can not be used when making a shared object”

Do what the compiler tells you to do, i.e. recompile with -fPIC. To learn what does this flag do and why you need it in this case, see Code Generation Options of the GCC manual. In brief, the term position independent code (PIC) refers to the generated machine code which is memory address agnostic, i.e. … Read more

C/C++ with GCC: Statically add resource files to executable/library

Update I have grown to prefer the control John Ripley’s assembly .incbin based solution offers and now use a variant on that. I have used objcopy (GNU binutils) to link the binary data from a file foo-data.bin into the data section of the executable: objcopy -B i386 -I binary -O elf32-i386 foo-data.bin foo-data.o This gives … Read more

Why can’t Python find shared objects that are in directories in sys.path?

sys.path is only searched for Python modules. For dynamic linked libraries, the paths searched must be in LD_LIBRARY_PATH. Check if your LD_LIBRARY_PATH includes /usr/local/lib, and if it doesn’t, add it and try again. Some more information (source): In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for … Read more

Importing from a relative path in Python

EDIT Nov 2014 (3 years later): Python 2.6 and 3.x supports proper relative imports, where you can avoid doing anything hacky. With this method, you know you are getting a relative import rather than an absolute import. The ‘..’ means, go to the directory above me: from ..Common import Common As a caveat, this will … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)