The specified module could not be found.
earth-hotfix opened this issue · comments
hello, I need help
- energy install .
- create main.go
package main
import (
"github.com/energye/energy/cef"
)
func main() {
//全局初始化 每个应用都必须调用的
cef.GlobalCEFInit(nil, nil)
//创建应用
cefApp := cef.NewApplication(nil)
//指定一个URL地址,或本地html文件目录
cef.BrowserWindow.Config.DefaultUrl = "http://192.168.10.100"
//运行应用
cef.Run(cefApp)
}
- go mod init demo
- go run main.go
an error has been generated
API server listening at: 127.0.0.1:65203
panic: Failed to load C:\Users\user\golcl\liblcl.dll: The specified module could not be found.
goroutine 1 [running]:
github.com/energye/golcl/lcl/api.loadUILib()
On Windows you need to configure the environment variable ENERGY_HOME=[frame directory]
Linux and MacOSX also require configuration
ENERGY_HOME environment variable configures the name root directory of the EnergyFramework generated by the energy command-line tool
ENERGY_HOME=/app/swt/EnergyFrameWork
Otherwise, if you don't want to configure environment variables, you need to copy liblcl.dll to the golcl directory in your home directory
But you need to set SetFrameworkDirPath in your code to the root directory created by the energy command-line tool
through
cfg := cef.NewApplicationConfig()
cfg.SetFrameworkDirPath("/app/swt/EnergyFrameWork")
cefApp := cef.NewApplication(cfg)
Command line tools have been updated to add environment variable configuration