[build2] Unable to consume unpackaged library

Luiz Fernando Afra Brito luizfernandoafrabrito at gmail.com
Wed Dec 26 01:27:39 UTC 2018


Hello,

I'm trying to initalize a project with GLFW library but I' getting
segmentation fault when I run *b* command.

I followed the documentation and, in my Linux environment, I end up writing
this bash script:

  file init_glfw_project.sh
  #!/bin/bash

  proj=$1
  cdir=$PWD

  if [ -z $proj ]; then
      echo "no project name found"
      echo "try this: sh $0 project_name"
      exit 1;
  fi

  mkdir -p 3rdparty build

  git clone https://github.com/glfw/glfw 3rdparty/glfw

  cd build
  cmake -DCMAKE_INSTALL_PREFIX=$cdir/unpkg-gcc $cdir/3rdparty/glfw
  make install

  cd $cdir
  bdep new -t exe -l c++ $proj

  cd $proj
  bdep init -C ../$proj-gcc @gcc cc config.cxx=g++ \
      config.cc.poptions=-I$cdir/unpkg-gcc/include \
      config.cc.loptions=-L$cdir/unpkg-gcc/lib64

  sed -i '1s/.*/import libs = GLFW%lib{glfw3}/' $proj/buildfile


Relevant parts of this script are: first it installs GLFW in unpkg-gcc
directory as a static library; then it creates an executable project and
initializes its configuration; and, finally, it adds import libs =
GLFW%lib{glfw3}  to the buildfile.

In terminal I typed:
$ ./init_glfw_project.sh myproj
$ cd myproj
$ b

and got:
[1]    5512 segmentation fault (core dumped)  b


What am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20181225/d2770f93/attachment.html>


More information about the users mailing list