set -ex
wget https://codeload.github.com/stevengj/nlopt/tar.gz/v2.7.0
tar -xzvf v2.7.0
cd nlopt-2.7.0 && mkdir build && cd build && cmake -DNLOPT_OCTAVE=Off -DNLOPT_MATLAB=Off -DNLOPT_GUILE=Off .. && make && sudo make install && cd ../..
After successful compilation (No error report), I ran a TEST SCRIPT, and it give the error messages like this:
COMPILE SCRIPT:
!/bin/sh
set -ex wget https://codeload.github.com/stevengj/nlopt/tar.gz/v2.7.0 tar -xzvf v2.7.0 cd nlopt-2.7.0 && mkdir build && cd build && cmake -DNLOPT_OCTAVE=Off -DNLOPT_MATLAB=Off -DNLOPT_GUILE=Off .. && make && sudo make install && cd ../..
After successful compilation (No error report), I ran a TEST SCRIPT, and it give the error messages like this:
github.com/go-nlopt/nlopt
../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:13:20: undefined: Func ../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:17:21: undefined: Mfunc ../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:30:26: undefined: Func ../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:31:32: undefined: Func ../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:34:27: undefined: Mfunc ../../../go/pkg/mod/github.com/go-nlopt/nlopt@v0.0.0-20230219125344-443d3362dcb5/cfunc_reg.go:35:32: undefined: Mfunc
This is the TEST SCRIPT i use: package main
import ( "fmt" "github.com/go-nlopt/nlopt" )
func main() { // 创建一个优化器 opt := nlopt.Create(nlopt.LN_COBYLA, 2)
}
I have tried all versions of nlopt and have reported this error. I have been stuck here for a long time. Can you give me some advice!!!