LOCNNIL commented on issue #176:
URL: 
https://github.com/apache/logging-log4cxx/issues/176#issuecomment-1381739897

   Currenty to find the libraries and compile the code I'm using the Cmake file 
`toolchain-arm-linux-gnueabi.cmake` that points to my toolchain.
   
   This is my toolchain file:
   
   ```cmake
   set(CMAKE_SYSTEM_PROCESSOR arm)
   set(CMAKE_SYSTEM_NAME Linux)
   set(CMAKE_SYSTEM_VERSION 1)
   
   set(cpu_flags "-march=armv7-a -mfloat-abi=softfp -mfpu=neon")
   set(c_cxx_flags " -O2 -fexpensive-optimizations -frename-registers 
-fomit-frame-pointer -pthread")
   
   set(CMAKE_C_COMPILER   /usr/bin/arm-linux-gnueabi-gcc ${cpu_flags})
   set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++ ${cpu_flags})
   
   set (CMAKE_SHARED_LINKER_FLAGS "-Wl,-start-group -lpthread -lm 
-Wl,-end-group -Wl,--rpath=${target_dir}/lib 
-Wl,--dynamic-linker=${target_dir}/lib/ld-linux.so.3 -Wl,-O3 
-Wl,--hash-style=gnu -Wl,--as-needed")
   
   set(CMAKE_C_FLAGS ${c_cxx_flags})
   set(CMAKE_CXX_FLAGS ${c_cxx_flags})
   set(CMAKE_STRIP /usr/bin/arm-linux-gnueabi-strip)
   set(CMAKE_FIND_ROOT_PATH  /usr/arm-linux-gnueabi)
   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
   set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
   ```
   
   I realized that my toolchain file was missing the specification `-pthread` 
to tell the compiler that I'm going to use the **thread** library. Also the 
linker flag `-lpthread` but this last is only for the linker and don't map the 
macros inside the library so I had to use both.
   
   But now I'm with a **different** error. It's a linking error too saying that:
   
   ```bash
   cannot find -lesmtp
   ```
   
   So now I'm going to cross compile libESMTP. But first, is this library realy 
necessary or just used for some feature? If so, is there an Cmake option where 
I can disable it?
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to