Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

expected unqualified-id before token... 'std::'

When i compile C++ code in an Android NDK project i get:

    expected unqualified-id before '(' token    FPEnvironment_DUMMY.h   /PocoFoundation/jni/include/Poco    line 98 C/C++ Problem

The error origins from the lines:

    inline bool FPEnvironmentImpl::isInfiniteImpl(double value)
    {
        return std::isinf(value) != 0;
    }

The following packet is included:

    #include <cmath>

It seems that the error disappear when i remove std::, why does this happen? I have to many source files to remove the class name std in all of them :/

like image 404
David Karlsson Avatar asked Apr 22 '26 21:04

David Karlsson


1 Answers

So the solution i found is :

remove std:: from the header-files signalled by the errors when building according to this

Since we next were going to include the static lib we built here in an eclipse-Android project the new compilation required std:: in the headers again so we simply reverted them back to their original style std::isinf etc. The usage of std:: depends on what stdlibrary you use, gnu or stdl_port..

The issue is discussed here

like image 122
David Karlsson Avatar answered Apr 24 '26 12:04

David Karlsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!