You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
$ buck build :main
buck-out/gen/main#compile-main.cpp.oa5b6a1ba,default/main.cpp.o: In function `main':
main.cpp:(.text+0x98): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
BUILD FAILED: //:main#binary failed with exit code 1:
c++ link
stderr: buck-out/gen/main#compile-main.cpp.oa5b6a1ba,default/main.cpp.o: In function `main':
main.cpp:(.text+0x98): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
[-] PROCESSING BUCK FILES...FINISHED 0.1s [100%] 🐌 New Buck instance
[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)
[-] BUILDING...FINISHED 0.4s [100%] (2/3 JOBS, 1 UPDATED, 1 [33.3%] CACHE MISS)
Compiling manually works:
c++ main.cpp -o main -lpthread
My setup:
$ buck --version
buck version v2017.05.31.01
$ c++ --version
c++ (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling a small pthread example results in an
undefined reference. It seems that Buck is not handling thelinker_flagscorrectly.Repo for this issue: https://github.com/njlr/buck-pthread-example
Here is the
BUCKfile:Here is the error:
Compiling manually works:
My setup: