Gautham Banasandra created HDFS-16665:
-----------------------------------------

             Summary: Fix duplicate sources for hdfspp_test_shim_static
                 Key: HDFS-16665
                 URL: https://issues.apache.org/jira/browse/HDFS-16665
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: libhdfs++
    Affects Versions: 3.4.0
         Environment: Windows 10
            Reporter: Gautham Banasandra
            Assignee: Gautham Banasandra


The library target *hdfspp_test_shim_static* is built using the following 
sources, which causes duplicate symbols to be defined -
1. hdfs_shim.c
2. ${LIBHDFSPP_BINDING_C}/hdfs.cc
https://github.com/apache/hadoop/blob/8774f178686487007dcf8c418c989b785a529000/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/CMakeLists.txt#L153

And fails the compilation -
{code}
H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj)
 : error LNK2005: hdfsAllowSnapshot already defined in 
hdfspp_test_shim_static.lib(hdfs.obj) 
H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj)
 : error LNK2005: hdfsAvailable already defined in 
hdfspp_test_shim_static.lib(hdfs.obj) 
H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj)
 : error LNK2005: hdfsBuilderConfSetStr already defined in 
hdfspp_test_shim_static.lib(hdfs.obj) 
H:\hadoop-hdfs-project\hadoop-hdfs-native-client\src\out\build\x64-Debug\hdfspp_test_shim_static.lib(hdfs_shim.obj)
 : error LNK2005: hdfsBuilderConnect already defined in 
hdfspp_test_shim_static.lib(hdfs.obj)
{code}

Duplicate symbols defined by hdfs_shim.c - 
https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L583-L585.

Adding the source *${LIBHDFSPP_BINDING_C}/hdfs.cc* is redundant here since this 
file is transitively included in hdfs_shim.c through *libhdfspp_wrapper.h* - 
https://github.com/apache/hadoop/blob/440f4c2b28515d2007b81ac00b549bbf14fa9f64/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/tests/hdfs_shim.c#L20.
 Thus, we need to exclude *${LIBHDFSPP_BINDING_C}/hdfs.cc* to fix this issue.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to