Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

linker error in building a minimal C++ application

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cmake, cpp
Domain
build-system

Research direction

Start by reproducing the minimal C++ application build with the nightly libtorch package and inspect the linker command for CMakeFiles/mymodel.dir/all. Review the supplied libtorch.so references and the reported entry point; done means the application links without these errors.

Written by the indexing model from the issue text.

Description

Hi there,
I tried to build a minimal C++ based on the latest nightly build of libtorch but got the following errors. Can someone help?
/lib/../lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main'
.../libtorch_nightly/lib/libtorch.so: undefined reference to lgammaf@GLIBC_2.23' .../libtorch_nightly/lib/libtorch.so: undefined reference to lgamma@GLIBC_2.23'
collect2: error: ld returned 1 exit status
gmake[3]: *** [stylegan] Error 1
gmake[2]: *** [CMakeFiles/mymodel.dir/all] Error 2
gmake[1]: *** [CMakeFiles/mymodel.dir/rule] Error 2
gmake: *** [mymodel] Error 2

Dominant language
HTML
Stars
256
Forks
37
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pytorch/cppdocs

All issues in pytorch/cppdocs

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.