mattn / mattn/go-sqlite3

build issues

Open
#850 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

This happens when I try "go get github.com/mattn/go-sqlite3".

# github.com/mattn/go-sqlite3
gcc did not produce error at completed:1
on input:

#line 1 "cgo-builtin-prolog"
#include <stddef.h> /* for ptrdiff_t and size_t below */

/* Define intgo when compiling with GCC.  */
typedef ptrdiff_t intgo;

#define GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; intgo n; } _GoString_;
typedef struct { char *p; intgo n; intgo c; } _GoBytes_;
_GoString_ GoString(char *p);
_GoString_ GoStringN(char *p, int l);
_GoBytes_ GoBytes(void *p, int n);
char *CString(_GoString_);
void *CBytes(_GoBytes_);
void *_CMalloc(size_t);

__attribute__ ((unused))
static size_t _GoStringLen(_GoString_ s) { return (size_t)s.n; }

__attribute__ ((unused))
static const char *_GoStringPtr(_GoString_ s) { return s.p; }
#line 8 "C:\\Users\\sanfe\\go\\pkg\\mod\\github.com\\mattn\\go-sqlite3@v1.14.2\\backup.go"

#ifndef USE_LIBSQLITE3
#include <sqlite3-binding.h>
#else
#include <sqlite3.h>
#endif
#include <stdlib.h>

#line 1 "cgo-generated-wrapper"
#line 1 "not-declared"
void __cgo_f_1_1(void) { __typeof__(CString) *__cgo_undefined__1; }
#line 1 "not-type"
void __cgo_f_1_2(void) { CString *__cgo_undefined__2; }
#line 1 "not-int-const"
void __cgo_f_1_3(void) { enum { __cgo_undefined__3 = (CString)*1 }; }
#line 1 "not-num-const"
void __cgo_f_1_4(void) { static const double __cgo_undefined__4 = (CString); }
#line 1 "not-str-lit"
void __cgo_f_1_5(void) { static const char __cgo_undefined__5[] = (CString); }
#line 2 "not-declared"
void __cgo_f_2_1(void) { __typeof__(free) *__cgo_undefined__1; }
#line 2 "not-type"
void __cgo_f_2_2(void) { free *__cgo_undefined__2; }
#line 2 "not-int-const"
void __cgo_f_2_3(void) { enum { __cgo_undefined__3 = (free)*1 }; }
#line 2 "not-num-const"
void __cgo_f_2_4(void) { static const double __cgo_undefined__4 = (free); }
#line 2 "not-str-lit"
void __cgo_f_2_5(void) { static const char __cgo_undefined__5[] = (free); }
#line 3 "not-declared"
void __cgo_f_3_1(void) { __typeof__(int) *__cgo_undefined__1; }
#line 3 "not-type"
void __cgo_f_3_2(void) { int *__cgo_undefined__2; }
#line 3 "not-int-const"
void __cgo_f_3_3(void) { enum { __cgo_undefined__3 = (int)*1 }; }
#line 3 "not-num-const"
void __cgo_f_3_4(void) { static const double __cgo_undefined__4 = (int); }
#line 3 "not-str-lit"
void __cgo_f_3_5(void) { static const char __cgo_undefined__5[] = (int); }
#line 4 "not-declared"
void __cgo_f_4_1(void) { __typeof__(sqlite3_backup) *__cgo_undefined__1; }
#line 4 "not-type"
void __cgo_f_4_2(void) { sqlite3_backup *__cgo_undefined__2; }
#line 4 "not-int-const"
void __cgo_f_4_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup)*1 }; }
#line 4 "not-num-const"
void __cgo_f_4_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup); }
#line 4 "not-str-lit"
void __cgo_f_4_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup); }
#line 5 "not-declared"
void __cgo_f_5_1(void) { __typeof__(sqlite3_backup_finish) *__cgo_undefined__1; }
#line 5 "not-type"
void __cgo_f_5_2(void) { sqlite3_backup_finish *__cgo_undefined__2; }
#line 5 "not-int-const"
void __cgo_f_5_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup_finish)*1 }; }
#line 5 "not-num-const"
void __cgo_f_5_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup_finish); }
#line 5 "not-str-lit"
void __cgo_f_5_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup_finish); }
#line 6 "not-declared"
void __cgo_f_6_1(void) { __typeof__(sqlite3_backup_init) *__cgo_undefined__1; }
#line 6 "not-type"
void __cgo_f_6_2(void) { sqlite3_backup_init *__cgo_undefined__2; }
#line 6 "not-int-const"
void __cgo_f_6_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup_init)*1 }; }
#line 6 "not-num-const"
void __cgo_f_6_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup_init); }
#line 6 "not-str-lit"
void __cgo_f_6_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup_init); }
#line 7 "not-declared"
void __cgo_f_7_1(void) { __typeof__(sqlite3_backup_pagecount) *__cgo_undefined__1; }
#line 7 "not-type"
void __cgo_f_7_2(void) { sqlite3_backup_pagecount *__cgo_undefined__2; }
#line 7 "not-int-const"
void __cgo_f_7_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup_pagecount)*1 }; }
#line 7 "not-num-const"
void __cgo_f_7_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup_pagecount); }
#line 7 "not-str-lit"
void __cgo_f_7_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup_pagecount); }
#line 8 "not-declared"
void __cgo_f_8_1(void) { __typeof__(sqlite3_backup_remaining) *__cgo_undefined__1; }
#line 8 "not-type"
void __cgo_f_8_2(void) { sqlite3_backup_remaining *__cgo_undefined__2; }
#line 8 "not-int-const"
void __cgo_f_8_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup_remaining)*1 }; }
#line 8 "not-num-const"
void __cgo_f_8_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup_remaining); }
#line 8 "not-str-lit"
void __cgo_f_8_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup_remaining); }
#line 9 "not-declared"
void __cgo_f_9_1(void) { __typeof__(sqlite3_backup_step) *__cgo_undefined__1; }
#line 9 "not-type"
void __cgo_f_9_2(void) { sqlite3_backup_step *__cgo_undefined__2; }
#line 9 "not-int-const"
void __cgo_f_9_3(void) { enum { __cgo_undefined__3 = (sqlite3_backup_step)*1 }; }
#line 9 "not-num-const"
void __cgo_f_9_4(void) { static const double __cgo_undefined__4 = (sqlite3_backup_step); }
#line 9 "not-str-lit"
void __cgo_f_9_5(void) { static const char __cgo_undefined__5[] = (sqlite3_backup_step); }
#line 1 "completed"
int __cgo__1 = __cgo__2;

full error output:
gcc: unrecognized option `-std=gnu99'
cc1.exe: Invalid option `64'
cc1.exe: warning: `-gdwarf-2' not supported by this configuration of GCC
cc1.exe: Invalid option `-Wno-deprecated-declarations'
cc1.exe: Invalid option `-fno-stack-protector'
not-type: In function `__cgo_f_1_2':
not-type:1: `__cgo_undefined__2' undeclared (first use in this function)
not-type:1: (Each undeclared identifier is reported only once
not-type:1: for each function it appears in.)
not-int-const: In function `__cgo_f_1_3':
not-int-const:1: invalid operands to binary *
not-int-const:1: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_1_4':
not-num-const:1: incompatible types in initialization
not-num-const:1: initializer element is not constant
not-str-lit: In function `__cgo_f_1_5':
not-str-lit:1: invalid initializer
not-type: In function `__cgo_f_2_2':
not-type:2: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_2_3':
not-int-const:2: invalid operands to binary *
not-int-const:2: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_2_4':
not-num-const:2: incompatible types in initialization
not-num-const:2: initializer element is not constant
not-str-lit: In function `__cgo_f_2_5':
not-str-lit:2: invalid initializer
not-int-const: In function `__cgo_f_3_3':
not-int-const:3: invalid type argument of `unary *'
not-int-const:3: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_3_4':
not-num-const:3: parse error before `;'
not-int-const: In function `__cgo_f_4_3':
not-int-const:4: invalid type argument of `unary *'
not-int-const:4: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_4_4':
not-num-const:4: parse error before `;'
not-type: In function `__cgo_f_5_2':
not-type:5: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_5_3':
not-int-const:5: invalid operands to binary *
not-int-const:5: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_5_4':
not-num-const:5: incompatible types in initialization
not-num-const:5: initializer element is not constant
not-str-lit: In function `__cgo_f_5_5':
not-str-lit:5: invalid initializer
not-type: In function `__cgo_f_6_2':
not-type:6: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_6_3':
not-int-const:6: invalid operands to binary *
not-int-const:6: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_6_4':
not-num-const:6: incompatible types in initialization
not-num-const:6: initializer element is not constant
not-str-lit: In function `__cgo_f_6_5':
not-str-lit:6: invalid initializer
not-type: In function `__cgo_f_7_2':
not-type:7: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_7_3':
not-int-const:7: invalid operands to binary *
not-int-const:7: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_7_4':
not-num-const:7: incompatible types in initialization
not-num-const:7: initializer element is not constant
not-str-lit: In function `__cgo_f_7_5':
not-str-lit:7: invalid initializer
not-type: In function `__cgo_f_8_2':
not-type:8: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_8_3':
not-int-const:8: invalid operands to binary *
not-int-const:8: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_8_4':
not-num-const:8: incompatible types in initialization
not-num-const:8: initializer element is not constant
not-str-lit: In function `__cgo_f_8_5':
not-str-lit:8: invalid initializer
not-type: In function `__cgo_f_9_2':
not-type:9: `__cgo_undefined__2' undeclared (first use in this function)
not-int-const: In function `__cgo_f_9_3':
not-int-const:9: invalid operands to binary *
not-int-const:9: enumerator value for `__cgo_undefined__3' not integer constant
not-num-const: In function `__cgo_f_9_4':
not-num-const:9: incompatible types in initialization
not-num-const:9: initializer element is not constant
not-str-lit: In function `__cgo_f_9_5':
not-str-lit:9: invalid initializer
completed: At top level:
completed:1: `__cgo__2' undeclared here (not in a function)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce go get github.com/mattn/go-sqlite3 on the reported Windows environment with the GCC toolchain, then inspect the cgo compilation around backup.go and sqlite3-binding.h. Done means the package builds successfully without the reported GCC option and generated-wrapper errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, go, sqlite
Domain
build-system, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.