Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 786 Bytes

README.markdown

File metadata and controls

40 lines (27 loc) · 786 Bytes

UR - undefined reference

Just a small project for easily locating omitted libraries at link time.

Usage

The first time ur is used, a database needs to be created

% ur -c

This will take a few minutes depending on the number of libraries installed.

A normal usage scenario:

% cat test.c
  #include <math.h>

  int main(){
    long double tmp = tanl(23);
    return 0;
 }
% clang test.c
  /tmp/test-JmcoIs.o:test.c:function main: error: undefined reference to 'tanl'
% clang test.c 2>&1 | ur
    -lm

To automatically rerun clang or gcc with the missing flags:

% ur -r -- clang test.c
    rerunning with missing flag : -lm

Build

% cabal configure
% cabal build
% cabal install