You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for making these two amazing libraries! Currently, I would like to the two libraries in my project. However, if I use both LBFGS++ and Spectra in a single translation unit, I would encounter compiling errors saying that symbol BKLDLT is undefined. A minimum code example to reproduce the problem is
I guess that the problem I encountered is due to the same include guard name BK_LDLT_H in the files named BKLDLT.h presented in both libraries as header dependencies. The library included later would see its BKLDLT.h as an almost empty file because the library included earlier already defines BK_LDLT_H. Normally that would be okay, because the contents in one file are simply reused for both libraries, but in this case the 2 BKLDLT.h files are almost identical except that they define class template BKLDLT in different namespaces, which makes the file in one library unusable for the other.
The problem goes away if I rename the include guard macros to make them different (such as LBFGSPP_BK_LDLT_H and SPECTRA_BK_LDLT_H). IMO this makes the header only libraries more separated and makes the include guard collisions highly unlikely. I'm curious to know what you think!
The text was updated successfully, but these errors were encountered:
Thank you for making these two amazing libraries! Currently, I would like to the two libraries in my project. However, if I use both LBFGS++ and Spectra in a single translation unit, I would encounter compiling errors saying that symbol
BKLDLT
is undefined. A minimum code example to reproduce the problem isI guess that the problem I encountered is due to the same include guard name
BK_LDLT_H
in the files namedBKLDLT.h
presented in both libraries as header dependencies. The library included later would see itsBKLDLT.h
as an almost empty file because the library included earlier already definesBK_LDLT_H
. Normally that would be okay, because the contents in one file are simply reused for both libraries, but in this case the 2BKLDLT.h
files are almost identical except that they define class templateBKLDLT
in different namespaces, which makes the file in one library unusable for the other.The problem goes away if I rename the include guard macros to make them different (such as
LBFGSPP_BK_LDLT_H
andSPECTRA_BK_LDLT_H
). IMO this makes the header only libraries more separated and makes the include guard collisions highly unlikely. I'm curious to know what you think!The text was updated successfully, but these errors were encountered: