COIN-OR::LEMON - Graph Library

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#487 closed defect (invalid)

Error with lemon/math.h and cmath

Reported by: Seth Owned by: Alpar Juttner
Priority: blocker Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:


I am still trying to compile the base test file included in the tutorial and whenever I go about doing so I get an error with the floor and ceiling calls in the included lemon/math.h file. Specifically I am getting a long list of errors from cmath saying that for example, "error C2039: 'acosf' : is not a member of '`global namespace". Is there any quick solution to this? I am using lemon-1.3.

Attachments (1)

a16b2b2a8c4e.patch (799 bytes) - added by Alpar Juttner 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by Alpar Juttner

Attachment: a16b2b2a8c4e.patch added

comment:1 Changed 10 years ago by Alpar Juttner

I cannot reproduce the problem. Could you please specify (even better: attach) the code you actually want to compile?

LEMON certainly does not do anything at all with acosf(). I believe it is actually a MSVC specific function.

However, I found two missing std:: namespace specifications in lemon/math.h. But this should not be the reason for your problem. Anyway, the attached patch fixes this issue.

comment:2 Changed 10 years ago by Seth

Thanks for your response.

I tried using the patch attached, but it didn't seem to make any difference. The code I am currently trying to compile is just the test file included in section two of the LEMON tutorial. The issue that I am coming across seems to be when I call namespace lemon the lemon/math.h header file is being called, which then calls cmath, cmath then calls Microsoft's math.h header file which should include the functions acosf() etc.. But I am getting a collision with lemon/math.h and thus those files cannot be found giving me the compile error.

comment:3 Changed 10 years ago by Seth

I have resolved the issue. I forced Visual Studio to include the standard math.h header file.

comment:4 Changed 10 years ago by Alpar Juttner

Resolution: invalid
Status: newclosed

Thanks for the update. I close this ticket, then.

comment:5 Changed 10 years ago by Alpar Juttner

The attached changeset has been merged to branches 1.3 and default as [6aea07d5ca48]

Note: See TracTickets for help on using tickets.