Comments (10)
OK so there was a misunderstanding. Cross compilation is not supported yet, we'll have a look what would be necessary to make it work.
from objectbox-go.
Closing in favour of #18 for the followup task (cross compilation support)
from objectbox-go.
You're trying to import github.com/objectbox/objectbox-go/internal/generator
which is an internal package. Go tool doesn't allow you to do that. What are you trying to achieve? What code is importing this package?
from objectbox-go.
I did it
$ GOOS=linux GOARCH=amd64 go build objectbox/shikure.go
../../../../pkg/mod/github.com/objectbox/[email protected]/objectbox/model.go:30:2: cannot find package
shikure.go is
package objectbox
import (
"log"
"net/http"
"strconv"
"time"
"github.com/labstack/echo"
"github.com/noriyuki-sasagawa/go_api/model"
"github.com/objectbox/objectbox-go/objectbox"
)
// GetShikureAll シクレ一覧取得
func GetShikureAll(c echo.Context) error {
// テーブル呼び出し
box := getBox()
var list []*model.Shikure
list, err := box.GetAll()
if err != nil {
return err
}
return c.JSON(http.StatusOK, list)
}
// AddShikure シクレ追加
func AddShikure(body string, version string) {
// テーブル呼び出し
box := getBox()
const dateLayout = "2006-01-02"
// データ追加
time.LoadLocation("Asia/Tokyo")
versionInt, _ := strconv.Atoi(version)
id, error := box.Put(&model.Shikure{
Content: body,
Hour: time.Now().Hour(),
Version: versionInt,
})
if error != nil {
log.Fatalln(error)
return
}
// 追加したデータを取得
_, error = box.Get(id)
if error != nil {
log.Fatalln(error)
}
}
// RemoveAllShikure シクレ情報全削除
func RemoveAllShikure() {
// テーブル呼び出し
box := getBox()
box.RemoveAll()
}
func getBox() *model.ShikureBox {
return model.BoxForShikure(initObjectBox())
}
func initObjectBox() *objectbox.ObjectBox {
objectBox, _ := objectbox.NewBuilder().Model(model.ObjectBoxModel()).Build()
return objectBox
}
from objectbox-go.
shikure.go is
package objectbox
^ this - your package is most certainly not supposed to be called objectbox
but rather something related to your project
from objectbox-go.
I installed it on Linux instead of Mac and built it.
Probably can't Cross Compile when installed on Mac?
from objectbox-go.
I installed it on Linux instead of Mac and built it.
Probably can't Cross Compile when installed on Mac?
Is this still related to the issue above? We're testing on mac and it works fine. Could you provide more details?
from objectbox-go.
What I wanted to do was compile for Linux on the Mac.
However, Mac had an error, so it was solved by compiling on Linux.
The problem still remains.
from objectbox-go.
I don't understand how those are related then, sorry.
Is your source publicly accessible? From what I've seen above, you're using an incorrect package name in shikure.go
- you're using objectbox
. I assume it's the name of the directory where this file is located - so your project looks sth. like: ..../objectbox/shikure.go
. If that's right, it's not going to work - this is not related to ObjectBox but rather to how Go packages work. To resolve, you need to rename the directory (and update the package objectbox
declaration in its files accordingly) to another name.
from objectbox-go.
Ah ~
First of all, it can be compiled on Mac and it can be compiled on Linux, so it is not a package issue.
Trying to compile for Linux on a Mac fails.
that's all.
So I thought that if I installed with shell, only Mac libraries would be installed on Mac.
It's a shame that you can't cross compile.
from objectbox-go.
Related Issues (20)
- Query: OR condition HOT 2
- Build fails on CentOS 7 due to gcc not running c99 mode HOT 1
- Following GETTING STARTED guide does not work HOT 4
- Self-assigned IDs HOT 3
- Maybe fix this ? HOT 3
- Encryption & static linking HOT 2
- Support sync-server
- Support "Flex" type
- Support "unique: replace on conflict"
- Installation fails under WSL2 HOT 2
- Repo is down - 502 Bad Gateway error HOT 3
- Cgo compile error with gcc on Windows 10 Pro: " undefined reference to `obx_txn_mark_success" HOT 6
- New Repo Creation [Objectbox-Rust] HOT 11
- Upgrade dependency "github.com/google/flatbuffers"
- Ignore some structs for code generation
- How to statically compile in golang so library is included?
- Version.LessThan() function not working properly
- Time property in inlined struct
- dyld Symbol not found: _obx_async on latest xcode, macos, and golang HOT 1
- Performance Benchmarks page has broken images HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objectbox-go.