[Fwd: `undefined reference` Error When Linking]

Andrew Makhorin <[email protected]>
Newsgroups gmane.comp.gnu.glpk
Message-ID <1522053577.4528.0.camel@corvax>
-------- Forwarded Message --------
From: Lam Ling <[email protected]>
To: [email protected]
Subject: `undefined reference` Error When Linking
Date: Mon, 26 Mar 2018 07:44:44 +0000

Hi all,


I built and installed glpk 4.65 from source, and I can verify that it's
successfully installed to `/usr/local/lib`. But when I tried to compile
a C++ program with glpk using gcc 5.4.0 on Ubuntu 16.04, I got many
undefined reference errors on the glpk functions.


Here's the g++ command I used:


g++ -I/home/linuxbrew/.linuxbrew/Cellar/eigen/3.3.4/include/eigen3
-I/usr/local/include -lm -L/usr/local/lib -lglpk -Wall -Ofast -std=c++11
util.cpp main.cpp -o main



And here's the full error message in a
gist: https://gist.github.com/hkalexling/ec5a3e704624ecaa05e23b451f957815


Thanks in advance,
Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.