1

I need to build GLEW from source so I can use it with Mingw in Code::Blocks being Mingw doesn't like to use the one's they compile in VS. I'm using Cygwin and I download the source for GLEW here and unzip it. I then browse to the folder with Cygwin using cd. Then I run

make Makefile

It then gives me these errors.

config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: `  case $1 in
config/config.guess: line 6: $'\r': command not found
config/config.guess: line 8: $'\r': command not found
config/config.guess: line 26: $'\r': command not found
config/config.guess: line 27: $'\r': command not found
config/config.guess: line 38: $'\r': command not found
config/config.guess: line 40: $'\r': command not found
config/config.guess: line 52: $'\r': command not found
config/config.guess: line 63: $'\r': command not found
config/config.guess: line 66: $'\r': command not found
config/config.guess: line 69: syntax error near unexpected token `$'in\r''
'onfig/config.guess: line 69: `  case $1 in
Makefile:40: *** "Platform '' not supported".  Stop.

I've read around and I haven't been able to find much useful on solving this problem yet. If you know a better way I can get GLEW working with Mingw that would also answer my question.

On Windows XP Using Code::Blocks 10.05 Using Cygwin 1.7.16-1 Using GLEW 1.8.0

UPDATE

Those errors have been fixed using dos2unix on the config.guess file. However, when I run the Makefile now it says there is nothing to be done for it.

Community
  • 1
  • 1
cgasser
  • 603
  • 2
  • 11
  • 24

3 Answers3

4

Looks very much like config.guess has DOS line endings ("\r\n") but make is expecting Unix line endings ("\n"). I would just run whatever tool on config.guess to convert it to Unix line endings, my cygwin has a tool called dos2unix that will do the trick.

jahhaj
  • 3,021
  • 1
  • 15
  • 8
  • That fixed those errors, thanks. However, now it's saying there is nothing to be done for the make file. Would you have any idea's there? – cgasser Aug 02 '12 at 22:27
  • Unfortunately I'm not familiar with GLEW so I can't make any suggestions. Unix builds can be a pig when they go wrong, unfortunately there no alternative but to look at the make file understand what it is trying to do and then figure out why it isn't doing it. – jahhaj Aug 03 '12 at 05:07
1

If you just want to code and build under Windows refer to this topic Using GLEW to use OpenGL extensions under Windows

Community
  • 1
  • 1
user827992
  • 1,743
  • 13
  • 25
  • That would work, but I'm not using VS I'm using Code::Blocks so I get a whole bunch of undefined references when trying to build. So I have to recompile it from source using Cywin. – cgasser Aug 02 '12 at 22:34
  • 1
    Probably you didn't set the right options for the inclusion of the headers and the libraries, anyway since Codeblocks uses MinGW you can refer to http://stackoverflow.com/questions/6005076/building-glew-on-with-mingw or you can try to set the right options in Codeblocks http://forums.codeblocks.org/index.php/topic,13055.0.html – user827992 Aug 02 '12 at 22:42
  • I've read both these topics. I've tried both solutions in the first link, none work. I've tried the second link to and that solution also didn't work. My errors are – cgasser Aug 02 '12 at 22:50
0

Sorry for the late reply on this, but setting a variable SYSTEM works in cygwin:

$ SYSTEM=cygwin make

OzBarry
  • 1,098
  • 1
  • 17
  • 44