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

A Header-Only Library? #2

Closed
ShihaoWang opened this issue Dec 15, 2019 · 0 comments
Closed

A Header-Only Library? #2

ShihaoWang opened this issue Dec 15, 2019 · 0 comments

Comments

@ShihaoWang
Copy link

Hi,

A compilation issue came to me when I would like to run the test code. It seems to me that this package is header-only and there is no need to compile sth. However, compilation error is reported during the link stage

CMakeFiles/MyApp.dir/src/main.cc.o: In function `demo_bezier()':
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:17: undefined reference to `Bezier::Bezier()'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:19: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:19: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:20: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:20: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:21: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:21: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:22: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:22: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:26: undefined reference to `Vector::toString[abi:cxx11]() const'
CMakeFiles/MyApp.dir/src/main.cc.o: In function `demo_bspline()':
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:32: undefined reference to `BSpline::BSpline()'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:34: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:34: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:35: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:35: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:36: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:36: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:37: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:37: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:41: undefined reference to `Vector::toString[abi:cxx11]() const'
CMakeFiles/MyApp.dir/src/main.cc.o: In function `demo_catmullrom()':
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:47: undefined reference to `CatmullRom::CatmullRom()'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:49: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:49: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:50: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:50: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:51: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:51: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:52: undefined reference to `Vector::Vector(double, double, double)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:52: undefined reference to `Curve::add_way_point(Vector const&)'
/home/motion/cpp-spline/spline/src/test/cpp/src/main.cc:56: undefined reference to `Vector::toString[abi:cxx11]() const'
CMakeFiles/MyApp.dir/src/main.cc.o: In function `Curve::node(int) const':
/home/motion/cpp-spline/spline/src/main/cpp/../../main/cpp/Curve.h:28: undefined reference to `Vector::Vector(Vector const&)'
collect2: error: ld returned 1 exit status
CMakeFiles/MyApp.dir/build.make:109: recipe for target 'MyApp' failed
make[2]: *** [MyApp] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/MyApp.dir/all' failed
make[1]: *** [CMakeFiles/MyApp.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Can you provide me with an insight about what could be the cause for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant