There was another build question in 2019 without solution.
Newest build for AIX is from 2014 (v1.63). Thus I want to build it by my own. But I can't get it working.
I tried to analyze the error: lib/standards.h:42:17: error: field 'stdValue' has incomplete type 'std::__cxx11::string' {aka 'std::__cxx
11::basic_string<char>'}
std::string stdValue;
I think it must be a configuration problem. A simple program #include <string> and std::string test; compiles without problems. Maybe the Makefile has to do something special on AIX?</string>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
strange!
standards.h does have a #include <string>.
do you use some different compiler or compile flags then when you compile your little test program?
do you get some interesting output when you try this command: g++ -fsyntax-only lib/standards.h.
have you tried the Makefile in the root folder? what problems do you get with that?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
lib/standards.h:42:17: error: field 'stdValue' has incomplete type 'std::__cxx11::string' {aka 'std::__cxx 11::basic_string<char>'} std::string stdValue;</char>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
g++-Ilib-isystemexternals-isystemexternals/picojson-isystemexternals/simplecpp-isystemexternals/tinyxml2-DFILESDIR=\"/usr/share/cppcheck\"-std=c++11-O2-DNDEBUG-Wall-Wno-sign-compare-std=c++11-c-obuild/analyzerinfo.obuild/analyzerinfo.cppInfileincludedfrom/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/wchar.h:44,from/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/cwchar:44,from/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/bits/postypes.h:40,from/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/bits/char_traits.h:40,from/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/string:40,fromlib/config.h:60,fromlib/analyzerinfo.h:24,frombuild/analyzerinfo.cpp:19:lib/standards.h:42:17:error:field'stdValue'hasincompletetype'std::__cxx11::string'{aka'std::__cxx11::basic_string<char>'} std::string stdValue; ^~~~~~~~In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/string:39, from lib/config.h:60, from lib/analyzerinfo.h:24, from build/analyzerinfo.cpp:19:/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include/c++/bits/stringfwd.h:71:11: note: declaration of 'std::__cxx11::string' {aka 'classstd::__cxx11::basic_string<char>'}classbasic_string;^~~~~~~~~~~~[...]
I also tried to use -std=c++x9, -std=c++17 and other flags but it didn't help.
This command doesn't work too:
I guess that your wchar.h:44 includes a file "standards.h" and the wrong file is included.
Maybe it will be necessary to avoid the -Ilib completely when compiling cppcheck.. if you copy all source files in cli and lib to the same folder that should work. Something like:
Thanks for that, Daniel. You're right. The wchar.h includes <standards.h>.
I copied all files that way and tried again.</standards.h>
At first, the build of analyzerinfo.cpp using your command doesn't have the string error anymore but another one:
In file included from lib/analyzerinfo.cpp:25:
externals/tinyxml2/tinyxml2.h:195:1: error: template with C linkage
template <class T, int INITIAL_SIZE>
^~~~~~~~
externals/tinyxml2/tinyxml2.h:337:1: error: template with C linkage
template< int ITEM_SIZE >
^~~~~~~~
externals/tinyxml2/tinyxml2.h:1896:5: error: template with C linkage
template<class NodeType, int PoolElementSize>
^~~~~~~~
externals/tinyxml2/tinyxml2.h:1900:1: error: template with C linkage
template<class NodeType, int PoolElementSize>
^~~~~~~~
Using your last g++ command, this error came up multiple times on other files too. The TRUE enum error is there too. I assume this could be fixed easily. But the linkage error is in tinyxml2.h and picojson.h.
Attached is the whole build log using your last g++ command.
There was another build question in 2019 without solution.
Newest build for AIX is from 2014 (v1.63). Thus I want to build it by my own. But I can't get it working.
Environment: AIX 7.2, gcc 8.1, g++, gmake 4.2.1, cmake 3.14
- cmake:
Using g++ directly outputs a hugh error log with messages like not findeing memcpy() and others.
Any hints how to build it on AIX?
Last edit: Michael 2021-05-26
Very strange.
Do you get the same output if you run g++ directly?
Same output:
I'm not a C++ expert. My research leads me to the assumption that TRUE is defined before. I tried something else and this file compiles:
Last edit: Michael 2021-05-27
Great find! You found the problem before I did. I will have to adapt simplecpp because it's pretty common that TRUE is defined like that.
But the whole project still doesn't build. This is the whole cmake output:
https://ghostbin.co/paste/49y7uk
Those
error: no match for 'operator=='
might perhaps be fixed if you use the match compiler;With this flag and the IfState change it looks better now. Still some errors. Output attached.
Last edit: Michael 2021-05-27
I tried to analyze the error:
lib/standards.h:42:17: error: field 'stdValue' has incomplete type 'std::__cxx11::string' {aka 'std::__cxx 11::basic_string<char>'} std::string stdValue;
I think it must be a configuration problem. A simple program #include <string> and std::string test; compiles without problems. Maybe the Makefile has to do something special on AIX?</string>
strange!
standards.h does have a
#include <string>
.do you use some different compiler or compile flags then when you compile your little test program?
do you get some interesting output when you try this command:
g++ -fsyntax-only lib/standards.h
.have you tried the Makefile in the root folder? what problems do you get with that?
Nothing special:
And my test program:
so what g++ command generate that compiler error?
lib/standards.h:42:17: error: field 'stdValue' has incomplete type 'std::__cxx11::string' {aka 'std::__cxx 11::basic_string<char>'} std::string stdValue;</char>
I can use the command from the build.log.
I also tried to use
-std=c++x9
,-std=c++17
and other flags but it didn't help.This command doesn't work too:
Last edit: Michael 2021-06-29
ok I think this command will work better:
Your error output:
I guess that your wchar.h:44 includes a file "standards.h" and the wrong file is included.
Maybe it will be necessary to avoid the
-Ilib
completely when compiling cppcheck.. if you copy all source files in cli and lib to the same folder that should work. Something like:Last edit: Daniel Marjamäki 2021-06-29
Thanks for that, Daniel. You're right. The wchar.h includes <standards.h>.
I copied all files that way and tried again.</standards.h>
At first, the build of analyzerinfo.cpp using your command doesn't have the string error anymore but another one:
Using your last g++ command, this error came up multiple times on other files too. The TRUE enum error is there too. I assume this could be fixed easily. But the linkage error is in tinyxml2.h and picojson.h.
Attached is the whole build log using your last g++ command.
Strange. Could you compress your folder
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0
and provide that?I only need the include folders..
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include
and
/opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.1.0/include-fixed
These files are provided by RPM package libstdc++-devel from here:
https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc-7.2/gcc/libstdcplusplus-devel-8-1.aix7.2.ppc.rpm
I attached the archive with the include files