0

im trying to build my first CMake project and it fails on CXX executable NeuralNetLibrary.

I get the undefined reference to FFLayer::test() error when building. The full project is in here https://github.com/JRazek/ConvolutionalNetLib. Please help me how can I solve this issue.

1 Answer 1

2

The reason is that you're missing dependencies between the different library projects. For example, the Net library uses a function defined in FFLayer in Net.cpp, but the corresponding target_link_libraries(Net PRIVATE FFLayer) is missing.

This causes CMake to link against the static libraries in the wrong order, as it assumes that there are no order constraints.

If you fix that you'll find that you still get a missing symbol error for the destructor of Layer, which isn't implemented. You can add a .cpp file with the definition or just add = default; to the existing declaration, in both cases it will build.

Sign up to request clarification or add additional context in comments.

1 Comment

It compiles. Thanks. :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.