-3

I was following the tutorial then when i followed it all the way though but when i went to run the code it gave me the cannot find -lsdlmain. I am using the minGW compiler and can use g++ in the command line from any directory. The full console out

23:32:34 **** Incremental Build of configuration Debug for project Game 1 ****
Info: Internal Builder is used for build
g++ -o "Game 1.exe" "src\\Game 1.o" -lmingw32 -lsdlmain -lsdl2 
b:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lsdlmain
collect2.exe: error: ld returned 1 exit status

23:32:35 Build Finished (took 272ms)
Martin G
  • 17,357
  • 9
  • 82
  • 98
Conor Groco
  • 17
  • 1
  • 4

1 Answers1

0

Add the path to the libraries:

g++ program.cpp -o executable -I /path/to/includes -L /path/to/libraries -l library1 -l library2

I'm guessing g++ doesn't know where to find your sdl libs because you have not added the path with -L

Martin G
  • 17,357
  • 9
  • 82
  • 98