Jump to content


Issues with C++ API

c++

  • Please log in to reply
4 replies to this topic

#1 dmuir

dmuir

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 13 September 2020 - 11:07 PM

I'm having two separate issues with the downloaded C++ libraries.

The first is that I'm attempting to use the p4api from Go.  Normally this wouldn't be a big issue since Go can call C/C++ via cgo.  However, on Windows, cgo requires the mingw toolchain, and for various arcane reasons, we're using mingw-w64, which doesn't seem to like the library downloaded from https://www.perforce...gwx86/p4api.zip (the link for 20.1 was a 404).  All symbols fail to resolve.  Is it possible to get a version of this library that works with mingw-w64?

The other issue doesn't involve Go at all, pure C++ on Windows.  Unfortunately, some of the other libraries we want to incorporate are linked with /MD where the msvc libp4api.lib appears to be linked with /MT, causing a linker failure.  Is there a /MD version of the library available?

Thanks.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 14 September 2020 - 01:12 AM

The client library is open source (available at workshop.perforce.com); you might have an easier time just building it from source than getting an "official" build that matches the specific environment/settings you need.

#3 dmuir

dmuir

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 14 September 2020 - 04:10 AM

That's great, but I can't seem to find the source for the C++ p4api.  Could you point me in the right direction?

#4 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1192 posts

Posted 14 September 2020 - 03:05 PM

https://swarm.worksh...rce_software-p4

#5 dmuir

dmuir

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 15 September 2020 - 02:11 PM

Thanks again.  Looks like there's nothing more recent than 2018-2?





Also tagged with one or more of these keywords: c++

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users