首页 > 系统相关 >ubuntu gurobi link error undefined reference

ubuntu gurobi link error undefined reference

时间:2023-03-26 16:44:11浏览次数:56  
标签:std cxx11 undefined lib gurobi ubuntu reference


link error

undefined reference to `GRBModel::addVar(double, double, double, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
undefined reference to `GRBModel::addConstr(GRBTempConstr const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
undefined reference to `GRBVar::get[abi:cxx11](GRB_StringAttr) const'

https://support.gurobi.com/hc/en-us/articles/360039093112-How-do-I-resolve-undefined-reference-errors-while-linking-Gurobi-in-C-

注意编译生成的lib名字可能是libgurobi_c++但是clion可能需要的是libgurobi_g++
而且要固定的版本号,这个先吧lib目录里面的lib都删掉,clion的输出中可以看到需要的版本
这个时候就能提示需要的版本号,例如4.8 这个时候就可以把编译生成的文件改成
gurobi_g++4.8.a


标签:std,cxx11,undefined,lib,gurobi,ubuntu,reference
From: https://blog.51cto.com/liyunhao/6150443

相关文章

  • ubuntu20.04 安装TensorRT c++库
    官方那个文档上有很多中安装方法,这里采用压缩包安装,解压后直接将lib和include文件配置在环境变量里就ok了,对于c++来说是最方便的首先下载TensorRT:https://developer.nvidia.......
  • ubuntu18.04离线 安装jdk8环境
    Jdkoracle官方下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html解压tar-zxvfjdk-8u152-linux-x64.tar.gz习惯上会......
  • Ubuntu 20.04部署kubernetes 1.24
    环境准备准备工作需要在所有节点上操作,包含的过程如下:配置主机名添加/etc/hosts清空防火墙设置apt源配置时间同步关闭swap配置内核参数加载ip_vs内核模块安装Containerd安装......
  • assembly of tiny problems I come across when using Ubuntu
    1.flameshotcouldn'tworkproperly.afterrunning,itdoesn'tacttoenableselectingareaasexpected,butpopoutaframeandIneedtoclick'share'andth......
  • undefined reference to
     可以看到  objdump-t./obj/ActiveBalance.o,显示的语言格式的函数, ......
  • Measuring the diversity of recommendations: a preference-aware approach for eval
    目录概RMSDE代码MeymandpourR.andDavisJ.G.Measuringthediversityofrecommendations:apreference-awareapproachforevaluatingandadjustingdiversity.......
  • Ubuntu常用命令
    软件安装&卸载sudoaptinstall<软件名>//安装软件最简单的方式sudoaptlist//查看所有已安装的软件列表sudoaptsearch<软件名>/......
  • 【Ubuntu】修改系统时间
    Ubuntu的时间分为两个种类Ubuntu时钟分为系统时钟(SystemClock)和硬件(RealTimeClock,简称RTC)时钟。查看系统时间date-R查看硬件时间sudohwclock--show修改Ubuntu系统时......
  • Ubuntu配置环境变量
    配置用户环境变量vim~/.bashrc刷新source~/.bashrc配置系统环境变量vim/etc/profile刷新sourceprofile......
  • ubuntu 22.04 dell 3571指纹识别
    指纹识别在linux能不能用看主要看有没有相关的驱动。3571带的指纹是ID0a5c:5843BroadcomCorp.58200,参照文档进行安装,有一点与文档不同,驱动目录需要切换到jammy分支。以......