MODULE.TARGET.SHARED_LIBRARIES.libjpeg already defined error
Asked Answered
H

2

9

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.

Hadhramaut answered 25/8, 2014 at 0:5 Comment(8)
Yes, you can't have two modules with the same name and type. One needs to go. AOSP 4.4.2 doesn't include a vendor/google directory. Where does that stuff come from?Humber
@MagnusBäck AFAIK vendor folder contain device specific configuration files. When I tried removing those files and start building, I get vendor files missing errors. But external/jpeg has just c and header files. I can't find where the shared variable is declaredHadhramaut
Yes, the vendor tree contains device-specific files. But again, AOSP 4.4.2 doesn't contain a vendor/google directory so the question of what code you're actually trying to build is relevant, even more so since your contents of vendor/google isn't compatible with the rest of the source tree. Not sure what you mean by shared variable. Your problem is that two directories attempt to define the same module.Humber
@MagnusBäck Thanks for getting back. In shared_variable I mean libjpeg, I can see libjpeg folder in vendor/google/libs folder but not in external/jpeg. I am not sure if I am going in right direction to solve the issue. Could you please explain what should I check and remove.Hadhramaut
Modules in the Android build system are defined in Android.mk files. Both vendor/google/libs/Android.mk and external/jpeg/Android.mk attempt to define a module named libjpeg. Without knowing more about what's in your vendor/google directory I can't tell what you should keep.Humber
@MagnusBäck # GoogleCamera include $(CLEAR_VARS) LOCAL_PREBUILT_LIBS := libgcam.so \ libgcam_swig_jni.so \ libjni_tinyplanet.so \ libjpeg.so \ liblightcycle.so \ libnativehelper_compat_libc++.so \ librefocus.so \ librs.layered_filter_f32.so \ librsjni.so \ libRSSupport.so LOCAL_MODULE_TAGS := optionalHadhramaut
That doesn't shed any light on my question. I'm outta here. Maybe someone else can help.Humber
@MagnusBäck Thanks for your help. As I mentioned earlier, when I tried removing any of the folders, I get some other errors stating missing files from those pathsHadhramaut
P
8

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.

Polk answered 21/10, 2014 at 14:37 Comment(0)
A
3

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.

Alack answered 18/9, 2018 at 6:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.