Registered Member
|
I am new to Eigen. Our software vendor has sent us their latest update (that includes Eigen) and I am supposed to try to build it in the QNX Momentics IDE. I do not have much information about the paths and any symbols that have to be defined as compiler arguments.
I am getting an error: "error: there are no arguments to 'log2' that depend on a template parameter, so a declaration of 'log2' must be available" from MatrixExponential.h. Any clues? Thanks in advance. |
Registered Member
|
I guess this means that your environment does not define the log2() function. Your IDE would not be alone in this; Visual Studio does not define it either even though it is included in some standard. If this is indeed the issue, then try activating the definition of log2() at the start of MatrixExponential.h inside the #ifdef _MSC_VER ... #endif
|
Registered Member
|
That is very interesting. MatrixExpoential.h does define log2() inside the #ifdef _MSC_VER ... #endif block, but it is not seeing _MSC_VER defined!
(This is the kind of problem I've been experiencing. One header needs something from another header that needs another header and so on.) Where is _MSC_VER supposed to be defined? |
Moderator
|
_MSC_VER is defined by Visual Studio when you compile with it. You could replace the #ifdef _MSC_VER by:
#if defined(_MSC_VER) || defined(__QNXNTO__) assuming that __QNXNTO__ is right token to detect your environment. |
Registered Member
|
__QNXNTO__ appears to be correct, but the problem has not gone away. I now do have log2 defined, but I am still getting the original message:
"error: there are no arguments to 'log2' that depend on a template parameter, so a declaration of 'log2' must be available" This is happening inside of the MatrixExponential.h header file, on a line that reads: pade5(*m_M); I don't see any references to 'log2' inside of pade5. Any more clues? |
Registered Member
|
NO, WAIT. I had the wrong header file inside my IDE. Nuts.
Now the log2 message is gone, but I am getting the same message for the "ceil" call. It is properly defined as far as I can tell. |
Moderator
|
hm that's very strange, I admit that log2 is not part of the standard but ceil really is. Are you using a standard scalar type?
|
Registered Member
|
As far as I can tell, everything is very much standard.
However, a Google search on the error came up with an article that indicates this is an issue with gcc, version 4.x. http://www.agapow.net/programming/cpp/n ... -parameter http://docs.redhat.com/docs/en-US/Red_H ... dings.html I am doing a little more research. |
Registered Member
|
Hey, ggael, you gave me a really good tip, slthough you may not have known it. When you said that ceil was part of the standard, I realized that the line showing the error --
m_squarings = std::max(0, (int)ceil(log2(m_l1norm / maxnorm))); has "std::" on the max call, but not ceil. I added the std class to ceil and the error is fixed. I still do not completely understand, but you might want to add this to the next release. Thank you for your help. I will likely have to ask more questions as I continue this process. |
Moderator
|
ok thanks for your finding! I admit I did not looked at the problematic source file....
|
Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar