You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "natale-p (via GitHub)" <gi...@apache.org> on 2023/02/10 14:15:33 UTC

[GitHub] [logging-log4cxx] natale-p opened a new issue, #194: Compile log4cxx statically

natale-p opened a new issue, #194:
URL: https://github.com/apache/logging-log4cxx/issues/194

   In https://github.com/apache/logging-log4cxx/blob/master/src/main/include/log4cxx/private/log4cxx_private.h.in we see:
   
   ```
   #if !defined(LOG4CXX) && !defined(LOG4CXX_TEST)
   #error "log4cxx/private/log4cxx_private.h should only be used within log4cxx implementation or tests"
   #endif
   ```
   
   But when compiling statically (`-DBUILD_SHARED_LIBS=OFF`) the definition added is `LOG4CXX_STATIC`, not `LOG4CXX`. Is that intended?
   
   Thanks


-- 
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: notifications-unsubscribe@logging.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4cxx] natale-p commented on issue #194: Compile log4cxx statically

Posted by "natale-p (via GitHub)" <gi...@apache.org>.
natale-p commented on issue #194:
URL: https://github.com/apache/logging-log4cxx/issues/194#issuecomment-1427591420

   I forgot to indicate that the problem is with log4cxx 0.13. I tried reproducing with the latest version, but it compiles correctly: no issue. So I suppose this issue can be closed, but for reference, it can be solved with the following:
   
   ```
   diff --git i/src/main/include/log4cxx/private/log4cxx_private.h.in w/src/main/include/log4cxx/private/log4cxx_private.h.in
   index 61e8e7ac..0e8dfb14 100644
   --- i/src/main/include/log4cxx/private/log4cxx_private.h.in
   +++ w/src/main/include/log4cxx/private/log4cxx_private.h.in
   @@ -26,7 +26,7 @@
   
    #include <log4cxx/log4cxx.h>
   
   -#if !defined(LOG4CXX) && !defined(LOG4CXX_TEST)
   +#if !defined(LOG4CXX) && !defined(LOG4CXX_TEST) && !defined(LOG4CXX_STATIC)
    #error "log4cxx/private/log4cxx_private.h should only be used within log4cxx implementation or tests"
    #endif
   
   ```
   
   (or with upgrading to 1.0.0)


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4cxx] rm5248 commented on issue #194: Compile log4cxx statically

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 commented on issue #194:
URL: https://github.com/apache/logging-log4cxx/issues/194#issuecomment-1426894631

   I noticed this a few weeks ago, but I think the problem may be coming from about this part of the src/main/cpp/CMakeLists.txt: https://github.com/apache/logging-log4cxx/blob/afeaab6d0f0107c77dfadcbe3708f170c48d5ed9/src/main/cpp/CMakeLists.txt#L23
   
   I think that most files that need to use the private header are simply doing `#define LOG4CXX 1` before they include the private header.  I can't remember if this caused an issue or not, I can't get it to happen on Linux at least.  It seems that `LOG4CXX` should always be defined(since we are compiling the library), but `LOG4CXX_STATIC` should only be defined if building a static library.


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4cxx] swebb2066 commented on issue #194: Compile log4cxx statically

Posted by "swebb2066 (via GitHub)" <gi...@apache.org>.
swebb2066 commented on issue #194:
URL: https://github.com/apache/logging-log4cxx/issues/194#issuecomment-1426595448

   Private header files are not _installed_ since log4cxx version 1.0, so the `#if !defined(LOG4CXX) && !defined(LOG4CXX_TEST)` test in log4cxx_private.h is only relevent to log4cxx developers.
   
   Could you describe the issue you encountered?


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4cxx] rm5248 closed issue #194: Compile log4cxx statically

Posted by "rm5248 (via GitHub)" <gi...@apache.org>.
rm5248 closed issue #194: Compile log4cxx statically
URL: https://github.com/apache/logging-log4cxx/issues/194


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org