0

I have followed the steps to install the AWS SDK for C++ on a linux machiine. Now I am struggling to figure out how to compile and run my code. I have a file called test.cpp and I am compiling it by running g++ -o something test.cpp

I tried to compile the test.cpp file with:

g++ -o something test.cpp

I expected the file to compile. Instead, I got this error message:

(std::__cxx11::basic_string<char, std::char_traits, std::allocator >)': test.cpp:(.text.ZN3Aws11DeleteArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvPT[ZN3Aws11DeleteArrayINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEvPT]+0xd9): undefined reference to `Aws::Free(void)' /usr/bin/ld: warning: creating DT_TEXTREL in a PIE

This is a subset of the error message.

  • also, I am relatively new to CPP, I am using this project to learn about CPP, so sorry if my question seems nooby lol – somecanadiandude Dec 26 '22 at 04:30
  • If you want gcc to link your test.cpp with some third party library then you need to tell that to gcc too. The aws-thing itself seems to suggest to use CMake for building it. – Öö Tiib Dec 26 '22 at 04:45
  • Just installing AWS is not enough, you also have to tell you compiler to link with it. For gcc and g++ that is done with the `-l`- and `-L` options. – john Dec 26 '22 at 06:33

0 Answers0