Giter Site home page Giter Site logo

Comments (5)

ZenLiuCN avatar ZenLiuCN commented on July 24, 2024 2

Hi, I just try to using static link under windows.

  1. compile a static lib from duckdb source (mingw)
  2. link it with go-duckdb
  3. run into the same trouble
  4. found inside duckdb.h
//
// duckdb.h
//
//
//===----------------------------------------------------------------------===//

#pragma once

// duplicate of duckdb/main/winapi.hpp
#ifndef DUCKDB_API
#ifdef _WIN32
#if defined(DUCKDB_BUILD_LIBRARY) && !defined(DUCKDB_BUILD_LOADABLE_EXTENSION)
#define DUCKDB_API __declspec(dllexport)
#else
#define DUCKDB_API //__declspec(dllimport) // !! here 
#endif
  1. comment out that part makes no link error when compile.

from go-duckdb.

candiduslynx avatar candiduslynx commented on July 24, 2024

Hi @marcboeker!
Can I suggest trying with https://github.com/ebitengine/purego instead of cgo?

from go-duckdb.

candiduslynx avatar candiduslynx commented on July 24, 2024

I also found the following issue that might be of use: golang/go#51007 (comment)

Could you try reproducing with Go 1.20+?

from go-duckdb.

marcboeker avatar marcboeker commented on July 24, 2024

I'm sorry, I only had access to a amd64 Windows VM for a short period of time to test this. ATM I'm not able to setup a amd64 based Windows VM on my M1 Mac, so I can't reproduce this. Do you have access to a Windows machine to test this with 1.20+?

from go-duckdb.

candiduslynx avatar candiduslynx commented on July 24, 2024

No, unfortunately. I was looking into the issue for cloudquery/cloudquery#8854, but the builds take a couple of hours to complete with the results we already have (+ I believe, the code needs rebasing, as the DuckDB version in the branch is stale).

However, looking at the issue it seems that the thing to look at is this:

  1. Check that the produced file is able to be linked statically
  2. Verify that the static linking is used instead of the dynamic one (dynamic may be somehow enforced for Go based on the CGO being used, as the __imp_ prefixes indicate an attempt to link against DLL instead of static linking).

from go-duckdb.

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.