Closed WilliamTambellini closed 6 years ago
same here with gcc 6.4.1
Are you doing a git clone and then including .h from there?
That's not how this is supposed to be used. The documentation covers this.
can you please elaborate how to compile the example mentioned above? As mentioned in #94, your guide is not reachable and the very minimal docs on https://nonius.io/ don't seem to mention it. I get the same error as above when using https://github.com/rmartinho/nonius/archive/v1.2.0-beta.1.tar.gz.
related to this, what is the main repo for this: your fork or this one here?
Sorry about the broken link. I moved to a different URL and updated the GitHub header but not the link in the README. I'll fix that promptly.
To compile anything that uses nonius you should use a release, which is a zip file with a single header (and a local copy of the docs at nonius.io) inside. The second paragraph on https://nonius.io/ links to the releases page. I guess I should be even more explicit and tell people that the links GitHub automatically adds to download "source code" as zips are not what they should download. Those zips are just direct copies of the repository, and the repository doesn't contain a single header file for obvious reasons. The first download link on each release page is the correct one.
And yes, this is the main repo.
The second paragraph on https://nonius.io/ links to the releases page.
The release link on https://nonius.io leads to the repository of your fork. Your fork does not contain any links on the release page except to the automatically generated source code packages. Only the libnonius release page contains links to single header release files.
It took me quite some time to spot the difference.
On ubuntu 16:
cd examples g++ -Wall -std=c++11 example1.cpp -I../include/nonius/ -I../include/ -o example1 -pthread /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function
_start': (.text+0x20): undefined reference to
main' collect2: error: ld returned 1 exit statusAdding
include <nonius/main.h++>
to the file include/nonius.h++ does fix that but well....