MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined error - kernel-module

I am trying to build kernel for AOSP 4.4.2 for a device. When I compile the kernel I get
build/core/base_rules.mk:134: *** vendor/google/libs:
MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined by external/jpeg. Stop.
I understand that the shared variable libjpeg is already defined and I need to remove one of them. Is that correct?
I tried looking in external/jpeg folder and I am not sure which file I have to look into. Could some one please tell me how to deal with this situation.

The error states that the Shared object libjpeg is already defined in other module google/libs and you are again trying to create it. So just try to rename the Android.mk file in google/libs folder or in external/jpeg folder. It fixes the issue.

I had encountered your error but the solution was not to change any Makefile or source. Simply I had forgotten to run environment setup script(in may AOSP tree: build/envsetup.sh) After running that, no error happens.

Related

CCS unresolved symbols in linker or compiler causing errors

I am newbee c programmer so be patient. I have a MSP430 C project in Code Composer Studio 7.3 using windows 7. My project (USB) was working fine and then I tried to add more code to incorporate a SPI interface and everything went sideways. I restored my original code but now have problems that weren't there before. Seems to compile but has several unresolved symbols errors in the linker (I think). I have searched/researched many answers to these types of problems on the forum and tried many things (over the past two days!!) and cannot resolve my problem. Possibly I made things worse by copying library/functions directly into my project directory but still didn't seem to change anything. The errors are related to standard MSP430 functions, not my code. My project tree looks like:
project tree
Errors from Console are:
console errors
From everything I have read it indicates that either I have a compiler library path problem or a linker file path problem. Tried a lot of combinations to no avail. Following are the compiler and linker path info:
linker 1
linker 2
If I look in my repository of library stuff downloaded from TI you can see that the dma.h and dma.c files which reference the error message lines in the files are there and I don't understand why the linker can't do its thing.
dma file tree
In the linker under library files I noticed the original libmath.a file didn't point to anything so I found one and added it (not help). Also the libc.a points to a section of 3 directories (different versions of a tool) which each have a different version of libc.a and I think I tried all of them. See below for directories
directories
Any help would be greatly appreciated
A CLUE POSSIBLY: CLUE? In my quest to solve my issues, I created a new CCs project and pasted my main.c file in and then went through a series of compiles solving the errors as the showed up. I was down to one error : can't open source file hal.h. I believe this is a file that was included with the usb example code I started with. After copying it into my project I am back to square on with all the errors listed above. To get here I only needed to point the compiler to driverlib to solve previous errors. The hal.h file seems to only include driverlib.h which is also referenced in my main function so why all the errors??
FIXED BUT WHY!!!
To solve this issue I imported the drivlib directory from the TI repo on my D drive into my project. Now everything compiles. Can anyone tell me why I had to do that given that I had path directives to look on my D drive?? Can it be related to search path length being too long?

How to include linux/module.h in my source file?

I have looked at other similar questions around stackoverflow, but it doesn't seem to work for me. I am trying to compile a code sample, and it needs these header files:
linux/module.h
linux/modversion.h
linux/sched.h
linux/tqueue.h
But I keep getting errors saying that those files can't be found. I know I should add them to the kernel, but can you please guide me through the process and tell me how to get this done. Thanks in advance for any help.
The code sample can be found here.
You probably want to compile kernel source code first, or check if the below path exists
/lib/modules/kernel-version/build
Or more precisely
/lib/modules/`uname -r`/build
Or
path to your kernel build
This is generally the path where your kernel build tree is present.
Needless to say normal gcc based compilation wont work here.
This should get you started
Some of these files are shipped with any linux distro in :
/usr/include/linux/
but if you haven't linux installed in your machine see linux source tree in github repo :
https://github.com/torvalds/linux/tree/master/include/linux

Statically Linking glib

I'm trying to statically link glib into my C program. I'm not sure what's the best way to do this. I downloaded the code and put it in a subdirectory called glib-2.36.4. I added "-Iglib-2.36.4" when using gcc. The glib.h is in the glib-2.36.4/glib directory and in that file there are references to other header files under the glib directory (such as #include ).
I'm not sure why that is since both glib.h and these other header files are at the same level (in glib subdirectory). I got a compile error due to galloca.h not being found (even though it's there). So I copied glib.h up one level and those errors went away. I then got an error about a missing glibconfig.h. I copied that from my usr directory and that error went away. I compiled my project and now I'm getting an error about undefined reference to g_ptr_array_new. I guess this must be because I haven't actually compiled glib. I had tried to build glib, but when I typed "./configure", but I got this message:
checking if arpa/nameser_compat.h is needed... configure: error: could not compile test program either way
I did install glib using yum, but I really want this code to run even if glib is not installed on a machine.
You need to install both glib and glib-dev via yum, compile using ./configure, (take a look in the ./configure script to see if there are any flags you need to supply or defines you need to produce the static build), without moving any files about, and then you need to compile your code using -i path/to/glib/includes and link with -L path/to/built/static/library

How to manage libstdc++.so.6: wrong ELF class: ELFCLASS64 at computer cluster

I have a problem with the libstdc++.so.6 library when I execute a program in MATLAB. The code works fine on my laptop and my desktop, which is why I'm sure the problem is a library or linking compatibility issue:
/home/arturo/Virality/viral_cluster_ml/Viral_features/code/segment_pedro/segment: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
I've google some answers on how to fix the library, and some say that I should remove the library to later re-install the correct version:
error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
The problem is that I can't afford the luxury to delete a library, because I am ssh'ing to a cluster at the lab I'm working in. I really wouldn't want to mess up any programs that are running at the cluster, so isn't there another way of fixing this problem? I'm hoping a solution similar to:
sudo apt-get install libstd++6
that doesn't require me to delete or modify any files, but rather to install them.
Or maybe the error is that I'm not linking the library correctly?
The file does exist, as when I use
locate libstd++.so.6
the computer finds it at these directories:
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2012b/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6
/usr/local/MATLAB/R2012b/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6.0.13
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2013a/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/MATLAB/R2013a_DCS/sys/os/glnxa64/libstdc++.so.6
/usr/local/MATLAB/R2013a_DCS/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/bin/glnxa64/libstdc++.so.6
/usr/local/Matlab_R2012a/bin/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/sys/os/glnxa64/libstdc++.so.6
/usr/local/Matlab_R2012a/sys/os/glnxa64/libstdc++.so.6.0.13
/usr/local/Matlab_R2012a/toolbox/sldv/sldv/polyspace-dvo/lib/x86-linux/libstdc++.so.6
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.py
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyc
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.13-gdb.pyo
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.13-gdb.pyo
I've also tried setting the path to the the file before running MATLAB, without anyluck:
LD_LIBRARY_PATH=/usr/lib64:/home/arturo/Virality/viral_cluster_ml/Viral_features/code/scene_sun ./matlab
Similar link and problem:
http://www.linuxquestions.org/questions/linux-newbie-8/apt-get-messed-up-812346/
Problem was solved by recompiling a subfolder of the code on the cluster.

Error during the executing a file with GMP library

I have installed gmp library many times and run several programs. Every time I run my first program after 'successful' compilation, i hit the following error.
./a.out: error while loading shared libraries:
libgmp.so.10: cannot open shared object file: No such file or directory
After immense amount of looking over the net, I was not able to resolve this issue correctly.
PS: One suggestion in one of the forums was to create the link to the library file in i think /usr/lib. But it was condemned badly in the same thread.
Eventually I want my code to run. A quick solution for this issue would be appreciated.
Thanks!!
Try ldd ./a.out which should show you where the system is looking for the lib. But yeah, it means that it's not correctly installed, or that the search path for this lib is not good.
So the symlink may be a good idea. How did you installed GMP on your computer? apt-like or compilation?

Resources