libdxfrw build error on Mac

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

libdxfrw build error on Mac

ken rector
Running mac OS X 10.15.7, Xcode 12.4
Attempting to build libdxfrw  at  https://github.com/LibreCAD/libdxfrw/tree/LibreCAD_3

I see the error below.
What might I do to overcome this?


librecad/libdxfrw-LibreCAD_3/build % make
[  4%] Building CXX object CMakeFiles/dxfrw.dir/src/intern/dwgbuffer.cpp.o
In file included from /Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/dwgbuffer.cpp:15:
In file included from /Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/../libdwgr.h:21:
/Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/../drw_objects.h:161:10: error:
      'parseDwg' overrides a member function but is not marked 'override'
      [-Werror,-Winconsistent-missing-override]
    bool parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs=0);
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

dxli
fixed

kenr wrote
Running mac OS X 10.15.7, Xcode 12.4
Attempting to build libdxfrw  at  https://github.com/LibreCAD/libdxfrw/tree/LibreCAD_3

I see the error below.
What might I do to overcome this?


librecad/libdxfrw-LibreCAD_3/build % make
[  4%] Building CXX object CMakeFiles/dxfrw.dir/src/intern/dwgbuffer.cpp.o
In file included from /Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/dwgbuffer.cpp:15:
In file included from /Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/../libdwgr.h:21:
/Users/admin/librecad/libdxfrw-LibreCAD_3/src/intern/../drw_objects.h:161:10: error:
      'parseDwg' overrides a member function but is not marked 'override'
      [-Werror,-Winconsistent-missing-override]
    bool parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs=0);
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

LordOfBikes
Administrator
In reply to this post by ken rector
You can remove -Winconsistent-missing-override from compiler options, if you know how to do this in CMake, then this issue should become a warning, which doesn't stop compilation.
Or you can append the keyword override in drw_objects.h, line 161, that it looks like this:
bool parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs=0) override;

There maybe other occurrences of this missing override issue.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

dxli
It's good to be clear in code though.

For example, we have the same function name parseDWG both overloaded and overrided. It helps to separate them into different names, probably more specific to the purposes of these methods.
LordOfBikes wrote
You can remove -Winconsistent-missing-override from compiler options, if you know how to do this in CMake, then this issue should become a warning, which doesn't stop compilation.
Or you can append the keyword override in drw_objects.h, line 161, that it looks like this:
bool parseDwg(DRW::Version version, dwgBuffer *buf, duint32 bs=0) override;

There maybe other occurrences of this missing override issue.
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

ken rector
In reply to this post by dxli
@dxli, Thanks for responding with this fix so quickly.

I see that branch LibreCAD_3 is 4 commits behind master and a couple of those commits are commented with DRW_Dimstyle: parseDWG specified override.

I don't see a pull request for those commits.  Is there a reason for that?

I'm not experienced with GitHub.  

Is there a way I can get these into my private branch?

Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

LordOfBikes
Administrator
@kenr, the LibreCAD_3 branch is just the one which is tested with LibreCAD_3 application.
I have no idea yet, why you run into those issues, when it works for others.
Maybe, because more modern compiler become more strict and trigger errors, where was warnings before.

Anyhow, you can simply use master branch instead of LibreCAD_3 to get latest changes from dxli.
git checkout master
should be all you need if your repo is clean.
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

ken rector
@armin,  I have installed Xcode 12.4 which is the latest version supported by Mac OSX Catalina which is old stuff for the Mac and no longer supported.

Cmake reports this about it.

-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032

LibreCAD build document doesn't say much about what compiler, just this.

On OS/X 10.9 or newer, use spec macx-g++ is the default. Alternatively, you may use the system default clang++ compiler instead of gcc。


I'm interested because I can't build LibreCAD because of some ++17 feature that I may ask about later.


Would you consider this a more modern compiler?
Would other Mac users be using an older version than this?
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

dxli
First, clang-12 is good for c++17. Second, we are NOT using c++17 in LibreCAD yet.

currently, we are only using c++14. Actually, c++14 was only being used in LibreCAD recently, but we shouldn't have compiler support issues for C++14 in 2023 now.

The issues of the "override" specifier should be fixed, and since these changes won't introduce any behavior change (if done properly), I have merged them into both LibreCAD_2 and LibreCAD_3.


kenr wrote
@armin,  I have installed Xcode 12.4 which is the latest version supported by Mac OSX Catalina which is old stuff for the Mac and no longer supported.

Cmake reports this about it.

-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032

LibreCAD build document doesn't say much about what compiler, just this.

On OS/X 10.9 or newer, use spec macx-g++ is the default. Alternatively, you may use the system default clang++ compiler instead of gcc。


I'm interested because I can't build LibreCAD because of some ++17 feature that I may ask about later.


Would you consider this a more modern compiler?
Would other Mac users be using an older version than this?
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

LordOfBikes
Administrator
I had to revert the LibreCAD_2 and LibreCAD_3 merges in libdxfrw repo. Details explained to @dxli in PM.
As said, if you want to use the changes from dxli, simply use the libdxfrw master branch instead of LibreCAD_3 branch.

What is still not clear to me, what you are doing and what's your intention.
Can you post the link to the build instructions you mentioned above. The build instructions are probably not up to date with the code base and tool chain evolution.
So knowing what's your goal can probably make things clearer.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: libdxfrw build error on Mac

ken rector
I found the build instructions at https://github.com/LibreCAD/libdxfrw/tree/master .

Running mac OS X 10.15.7, Xcode 12.4

I used the debug version.  

Those instructions seem adequate and the build completed correctly with @dixli's fix.

I should probably not have mentioned the librecad ++17 problem as that is a separate issue that belongs in a different thread.

My goal/intention is to build libdxfrw on my mac as stated in my first post.  I don't necessarily need V3 so the fix in master solves my problem.