agvxov / contra

The Contra utility converts the so called C Style Markup Language to HTML/XML and back.
1 stars 1 forks source link

Build error #1

Closed paddymul closed 3 days ago

paddymul commented 3 weeks ago

I ran this on os x, xcode installed.

c++ -O3 -fno-stack-protector -fno-exceptions -fno-rtti   -c -o object//main.o source//main.cpp
lex --prefix=from_xml_to_csml_  -o source//from_xml_to_csml.cpp source//from_xml_to_csml.l
source//from_xml_to_csml.l:278: warning, -s option given but default rule can be matched
c++ -O3 -fno-stack-protector -fno-exceptions -fno-rtti   -c -o object//from_xml_to_csml.o source//from_xml_to_csml.cpp
In file included from source//from_xml_to_csml.l:7:
source/html_special.hpp:18:1: warning: inline variables are a C++17 extension [-Wc++17-extensions]
inline
^
source//from_xml_to_csml.l:146:12: error: no member named 'emplace' in 'std::stack<std::string>'
        tag_stack.emplace(yytext);
        ~~~~~~~~~ ^
1 warning and 1 error generated.
make: *** [object//from_xml_to_csml.o] Error 1
rm source//from_xml_to_csml.cpp

I don't compile a lot of C/C++ code. Wouldn't I normally have to run configure that would catch needed requirements?

Maybe you could list the home brew packages necessary to compile on os x. or the apt-get install for ubuntu.

agvxov commented 3 weeks ago

It's not a dependency error, the compiler is complaining about the standard library. std::stack::emplace is a C++11 feature and I assume your compiler defaults to something older? However, on my system, reasonably recent versions of both g++ and clang++ default to C++17, so I'm not sure why that would happen.

Could you run this please?:

echo | c++ -dM -E -x c++ - | grep __cplusplus

If it comes out as something older, than I should clearly explicitly add a standard version flag to the Makefile, otherwise I'll have to look into it deeper.

Configure is mostly used for checking for libraries, Contra only depends on build tools (the compiler and the Flex transpiler).

paddymul commented 3 weeks ago
echo | c++ -dM -E -x c++ - | grep __cplusplus
#define __cplusplus 199711L
agvxov commented 3 weeks ago

Ok, well, I'm quite surprised. May I ask what kind of compiler that is?

Regardless, 20fe40005ecc6800e1009cfbc55558856d63e69e should fix it.