C++ make file error

Question:
My code for c++ is not working …it seems to be a makefile error.
I have linked my replit.
Also i am stuggling to output to my “output2.txt” file;

Current behavior:
This is what the terminal shows:

sh -c make -s
/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: /tmp/hw1-20ad8d.o: in function `main':
/home/runner/Hw1/./hw1.cpp:103: undefined reference to `void LinkedList::remove<int>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int)'
/nix/store/039g378vc3pc3dvi9dzdlrd0i4q93qwf-binutils-2.39/bin/ld: /home/runner/Hw1/./hw1.cpp:98: undefined reference to `void LinkedList::remove<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:10: main] Error 1
exit status 2

Desired behavior

Repl link:
https://replit.com/@oliviaMott/Hw1#hw1.cpp

code snippet

1 Like

Hi @oliviaMott thank you for your post and sincere apologies for the delay in responding to this.

I didn’t see the link in your original post as it was hidden in the code snippet section. I’ve edited the original post to show it.

When I access your Repl it now shows the following:

image

Does this mean you have resolved your issue or do have any other questions?

1 Like

try:

#include <iostream>

int main() {
     freopen("output.txt", "w", stdout);
     std::cout << "Hello there";
}
2 Likes