Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Under-linking issue: -lm #5

Closed
nehaljwani opened this issue Jun 11, 2023 · 0 comments · Fixed by #6
Closed

Under-linking issue: -lm #5

nehaljwani opened this issue Jun 11, 2023 · 0 comments · Fixed by #6
Labels
bug Something isn't working

Comments

@nehaljwani
Copy link
Member

nehaljwani commented Jun 11, 2023

Issue

# Create a dev environment with gts and deps
$ conda create -p ./dev -c conda-forge gts glib

# Activate the dev environment
$ conda activate ./dev

# Create a very small reproducible example to highlight the issue
$ cat <<EOF > example.c
#include <gts.h>

int main()
{
	GtsVector normalisedAxis;
        gts_matrix_rotate(NULL, normalisedAxis, 1.0);
        return 0;
}
EOF

# Compile the example, and that leads to link failures:
$ gcc \
  $(PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig pkg-config -cflags gts) \
  $(PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig pkg-config --libs gts) \
  example.c 
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `sincos'
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `atan2'
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `exp'
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `cos'
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `log'
/usr/bin/ld: /tmp/nwani_1686490018/dev/lib/libgts.so: undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant