0

I have 3 files. these compile in visual studio.

in2post.cpp

long.h

long.hpp,

long.h #includes long.hpp

and both long.hpp and in2post.hpp #include in2post

my makefile looks like this

in2post: in2post.o
        g++  -std=c++11 -o in2post.o in2post

in2post.o: in2post.cpp long.hpp long.h
        g++ -std=c++11 -c in2post.cpp

clean:
        rm *.o in2post

I get

hook@linprog2:~>make
g++ -std=c++11 -c in2post.cpp
In file included from long.h:40:0,
                 from in2post.cpp:3:
long.hpp: In member function ârob::Long<T>& rob::Long<T>::operator=(rob::Long<T>&&)â:
Long.hpp:36:1: error: expected â;â before â}â token
 }
 ^
makefile:5: recipe for target 'in2post.o' failed
make: *** [in2post.o] Error 1
hook@linprog2:~>nano makefile

1 Answers1

0

It seems that g++ has encountered some weird characters and can't parse the file. My advice is to open the file in a plain text editor like vim and delete&reinsert the space before rob::Long<T> (it may be an invisible char) and delete the character at the end of the function declaration operator=(rob::Long<T>&&)â.

asalic
  • 664
  • 3
  • 6