Giter Club home page Giter Club logo

Comments (8)

sandrokeil avatar sandrokeil commented on September 26, 2024

Looks like we have to create an own main package because of building the go driver leads to errors.

-buildmode=c-archive requires exactly one main package
-buildmode=c-shared requires exactly one main package

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

Here is an example blog post how to build c-shared.

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

@martin-schilling I've created a new branch golang which builds the c archive from go-velocypack. Now we have to find a way to call test() from the php-cpp main file. I guess there is some linker fun ;-)

We have to check what does this mean exactly

The only callable symbols will be those functions exported using a cgo //export comment

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

@martin-schilling I've added a test case. Now it's your turn. ;-) We have the following issues:

g++: warning: go/arangodb.a: linker input file unused because linking not done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/arangodb.so' - /usr/lib/php/20160303/arangodb.so: 
invalid ELF header in Unknown on line 0
PHP Fatal error:  Uncaught Error: Call to undefined function vpack() in /app/test.php:13
Stack trace:
#0 {main}
  thrown in /app/test.php on line 13

Fatal error: Uncaught Error: Call to undefined function vpack() in /app/test.php:13
Stack trace:
#0 {main}
  thrown in /app/test.php on line 13

from arangodb-php-driver.

martin-schilling avatar martin-schilling commented on September 26, 2024

@sandrokeil The linking stuff should hopefully be fixed now. I think the next aim should be getting some database interaction going in a test case.

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

@martin-schilling Thanks so much. I want to try the vpack example from the master branch first and maybe the go return value mapping. You can bring a new PR with the connection if you have time. 👍

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

There is an important issue

The correct program should use a type defined in C, rather than in Go, because otherwise the external C programs have to manually define a C struct matching the Go struct, which is non-trivial and error-prone.

from arangodb-php-driver.

sandrokeil avatar sandrokeil commented on September 26, 2024

We stick with C++.

from arangodb-php-driver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.