COIN-OR::LEMON - Graph Library

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#487 closed defect (invalid)

Error with lemon/math.h and cmath

Reported by: smh5777 Owned by: alpar
Priority: blocker Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

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 4 years ago.

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by alpar

comment:1 Changed 4 years ago by alpar

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 4 years ago by smh5777

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 4 years ago by smh5777

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

comment:4 Changed 3 years ago by alpar

  • Resolution set to invalid
  • Status changed from new to closed

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

comment:5 Changed 3 years ago by alpar

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

Note: See TracTickets for help on using tickets.