Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Inline::CPP + OpenCV = problems

by bliako (Monsignor)
on Nov 20, 2019 at 00:10 UTC ( [id://11108920]=note: print w/replies, xml ) Need Help??


in reply to Inline::CPP + OpenCV = problems

If I pack all OpenCV function calls inside a very high-level function in a new C++ library and avoid any inclusion of OpenCV headers in the perl script then it works, obviously.

Replies are listed 'Best First'.
Re^2: Inline::CPP + OpenCV = problems
by Anonymous Monk on Nov 20, 2019 at 12:48 UTC
    Cpp code before inline/xs code in sourcefile avoids collisions? Also XSpp

      Thanks for the idea but the order is determined by Inline::CPP when it creates the XS file in folder _Inline/build. Perl headers come first. However I did change the order of the includes manually (e.g. without re-perling, I went into said folder and edited the XS file). The first error (seed redefined) is gone (something tells me it will reappear if/when I make Perl call its seed) but the second error (e.g. namespace cv clashes with struct cv) persists (obviously).

      My knowledge of XS is zero, but wouldn't using XS/XSpp require including those OpenCV headers? And still get the clash with Perl's headers?

        the order is determined by Inline::CPP when it creates the XS file in folder _Inline/build. Perl headers come first

        Inline::C has the PRE_HEAD Config option that enables one to place the code of one's choice *before* the perl headers. I haven't specifically checked, but I would expect the PRE_HEAD option works also with Inline::CPP.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108920]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-26 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found