# UndefVarError: \_pass\_variable\_names\_to\_solver not defined - Xpress solver in Julia

**URL:** <https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292>\
**Category:** Optimization (Mathematical)\
**Created:** [May 23, 2023, 3:10pm UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292 "2023-05-23T15:10:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ignacio](https://avatars.discourse-cdn.com/v4/letter/i/eb9ed0/32.png) [@Ignacio](https://discourse.julialang.org/u/Ignacio)\
**Post date:** [May 23, 2023, 3:10pm UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292/1 "2023-05-23T15:10:16Z")

</div>

Good evening,

I am building an optimization model, in which I want to pass the names of the variables and constranits to the solver, so an IIS can be built afterwards if the problem turns out to be infeasible. I am using the Xpress solver, the JuMP math library and programming in Julia through VS Code.

After declaring the optimization model, I try to run the function \_pass\_variable\_names\_to\_solve from the C API, but so far have been unable to make it run.

using MathOptInterface  
using JuMP  
using Xpress  
Xpress.\_pass\_variable\_names\_to\_solver(backend(optimizer))

I keep getting the following error, does anybody know how to overcome these limitations?

ERROR: UndefVarError: \_pass\_variable\_names\_to\_solver not defined  
Stacktrace:  
[1] getproperty(x::Module, f::Symbol)  
@ Base ./Base.jl:31  
[2] top-level scope  
@ REPL[85]:1

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 23, 2023, 7:05pm UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292/2 "2023-05-23T19:05:21Z")

</div>

Hi there!

Where did you see to call that function?

Xpress.jl doesn’t support passing names to the C API, and that function does not exist.

---

<div class="post-metadata">

**Author:** ![Ignacio](https://avatars.discourse-cdn.com/v4/letter/i/eb9ed0/32.png) [@Ignacio](https://discourse.julialang.org/u/Ignacio)\
**Post date:** [May 24, 2023, 9:04am UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292/3 "2023-05-24T09:04:44Z")

</div>

Hello again,

Thank you for your response, I found this function in the MOI (MathOptInterface) library and believed I could use it in this particular case.

Also, when do you believe that Xpress will be able to pass names to the C API, if it will at any time?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [May 24, 2023, 10:19am UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292/4 "2023-05-24T10:19:03Z")

</div>

> I found this function in the MOI (MathOptInterface) library and believed I could use it in this particular case.

In general, functions beginning with `_` are private and not intended for use outside of the package.

> Also, when do you believe that Xpress will be able to pass names to the C API, if it will at any time?

I think there was some performance issue, or problem with duplicate names that meant it was really hard to match up the names that JuMP supports and the names that Xpress supports. @joaquimg is the Xpress guru, so he might know.

---

<div class="post-metadata">

**Author:** ![joaquimg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joaquimg/32/223_2.png) [@joaquimg](https://discourse.julialang.org/u/joaquimg)\
**Post date:** [May 31, 2023, 7:41am UTC](https://discourse.julialang.org/t/undefvarerror-pass-variable-names-to-solver-not-defined-xpress-solver-in-julia/99292/5 "2023-05-31T07:41:12Z")

</div>

@odow is correct.  
There are two issues:

- performance
- duplicate names

Is there and specific use case or MWE?

Also, are you in the latest version locally?
