IEDB/TCRMatch

Subject: Including the <sstream> header to resolve stringstream-related compilation errors

Closed this issue · 2 comments

I hope this message finds you well. I recently encountered some compilation errors when attempting to build the TCRMatch project using the following command:

g++ -std=c++11 -fopenmp -O3 -g -o tcrmatch src/tcrmatch.cpp

The errors seem to be related to the std::stringstream type being incomplete.

src/tcrmatch.cpp: In function 'std::vector<std::basic_string > read_IEDB_data(std::string)':
src/tcrmatch.cpp:106:30: error: variable 'std::stringstream ss' has initializer but incomplete type
std::stringstream ss(line);
^
src/tcrmatch.cpp: In function 'std::map<std::basic_string, std::vector<IEDB_data_row> > create_IEDB_map(std::string)':
src/tcrmatch.cpp:140:34: error: variable 'std::stringstream buffer' has initializer but incomplete type
std::stringstream buffer(line);
^

After analyzing the src/tcrmatch.cpp file, I noticed that the header is not included. To resolve the compilation errors, I suggest adding the following line at the beginning of the src/tcrmatch.cpp file:

#include

By including the header, the compilation errors related to std::stringstream should be resolved. I hope you find this suggestion helpful, and I encourage you to consider incorporating this change into the project.

by gpt4

I have the same issue above.
I'm actually working in an environment running an old version of GCC (4.8.5) and i had to modify the makefile (adding the flag -std=c++11) and then adding #include to src/tcrmatch.cpp in order to compile.

Greetings

I ran some tests and I can confirm that

  1. It compiles without the header sstream with g++ 12.2
  2. It fails with -std=c++11 without the header sstream
  3. Whether I include or not the header, it works with -std=c++17
  4. If I include the header sstream and -std=c++11 to the Makefile, It compiles with from g++ 7.5 to g++12.2. Considering @mbarcella reported that it worked with gcc 4.8 (!), I'll update tcrmatch.cpp to include the header and add -std=c++11 to the Makefile. Thanks for the suggestions!