1

When I try to #include boost 1.60 headers, gcc fails. I'm at a loss because of this and would be appreciative of any help/guidance. I am using Fedora Linux and Netbeans 8.2.
This question was originally posted under user:user11551798, for which I don't have a password since it was posted from my mobile app.

Code snippet:

#include <boost/regex.hpp>
#include <boost/xpressive/xpressive.hpp>
#include <boost/asio.hpp>

(all three fail within the #includes)

Compiler call (from Netbeans) gcc -O ALAN ALAn.gcc

Errors (sample from asio.hpp)

g++ -g -m64 -lboost_system   -c   -o ALAn.o ALAn.cpp ALAn.cpp: In
Function »int main(int, char**)«: ALAn.cpp:57:23: Error: no matching function for call to 
»boost::asio::ip::basic_resolver<boost::asio::ip::tcp>::basic_resolver()«
    ip::tcp::resolver resolv;
                      ^~~~~~

Compiler error displayed means "No available function"/"Unmatched external symbol".

As always, thank you for any assistance, Im currently at a loss. And of course, sorry in adv for any transgressions. Im new here.

@yksisarvinen, @Mathieu I now installed the Boost V1.71 lib. Same problem :-(

rd0002
  • 11
  • 6
  • Do you have the same problem if you use Boost 1.71.0? – Eljay Oct 17 '19 at 09:31
  • Could you please translate error message to English? It looks like [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix), but I can't be sure – Yksisarvinen Oct 17 '19 at 09:32
  • I havent yet installed Boost 1.71. Will try it. Should IMHO not be an with "high quality libraries". Error is: "no available function/undefined external symbol" – rd0002 Oct 17 '19 at 09:42
  • 1
    The error message shows that this is not the full code snippet. Please [edit] your question to include a code sample that reproduces the error. (Also note: The error you show is _not_ in the boost headers. It is within your `main` function in `ALAn.cpp`.) – Max Langhof Oct 17 '19 at 09:48
  • The error does not happen in the headers. The error message clearly shows that it happens in your own code (ALAn.cpp line 57). – Cubic Oct 17 '19 at 12:09
  • not terribly familiar with asio, but it looks like `ip::tcp::resolver` doesn't have a default constructor... – kmdreko Oct 17 '19 at 12:21
  • @Cubic - Those errors DO occur in the headers.Problems in my code only happen as follow-ups. – rd0002 Oct 17 '19 at 12:55
  • @kmdreko Granted ... But then, why can I include the resolver method? (it's documented). – rd0002 Oct 17 '19 at 13:01
  • @rd0002 not sure what you mean by your question, for one `ip::tcp::resolver` is a class and not a method, and lots of things don't have default constructors, that doesn't mean you can't include them and use them, just you need to construct them properly – kmdreko Oct 17 '19 at 14:03
  • Understood, @kmrdeko. TY. – rd0002 Oct 17 '19 at 15:30

1 Answers1

0

The enlightenment came after I upgraded Boost from V1.60 to V1.71 and my problems persisted. I was sure that I had deleted the old files with rm -vf.
So I looked at this closer.
It sure was not sync(1) because some problems persisted after syncing. I looked at the GCC tools, which I use (this is Linux). It turned out that it HAS a little known (to me) compiler cache utility, CCACHE(1).
So I cleared the compiler cache, ccache -c. This made visible that the Boost lib tool does not compile some headers for some sui-generis reason, including regex and xpressive, which I use.
So I corrected that and Voilá! everything worked :-)

Dharman
  • 30,962
  • 25
  • 85
  • 135
rd0002
  • 11
  • 6