compile problem: cmath not found
Posted: 08 Jan 2011, 18:07
Hello,
I've followed the slightly outdated MinGW compile guide for compiling on(and for) Windows, and, after getting the hang of Git and installing dependencies such as bison & flex, installed the includes such as SDL and libpng (manually at first, then found the 2009 devpkg on sourceforge: out of date, but quicker than downloading & extracting each package manually).
However, despite installing everything described in the old guide, I am still receiving 'file not found' errors, regarding cmath:
(the most pertinent part afaict is at the bottom)
I've done a little research, and I now know cmath is part of the C++ standard library. But what I don't understand is why gcc (or make) cannot find it (i did find a copy inside an obscure subdirectory of mingw, but i doubt this is reachable or useable by the compiler).
Although i only found the C version math.h inside "mingw/include", I had hoped that there might be some sort of automatic conversion into the C++ format; and if there wasn't, then why weren't the C++ standard headers included in my copy of gcc? Have I installed the wrong version somewhere?
I am sure I've missed something simple somewhere(and am sorry to waste people's time something probably quite simple); but not knowing what to look for, I have no idea what.
Someone please point out my mistake.
Thankyou
I've followed the slightly outdated MinGW compile guide for compiling on(and for) Windows, and, after getting the hang of Git and installing dependencies such as bison & flex, installed the includes such as SDL and libpng (manually at first, then found the 2009 devpkg on sourceforge: out of date, but quicker than downloading & extracting each package manually).
However, despite installing everything described in the old guide, I am still receiving 'file not found' errors, regarding cmath:
(the most pertinent part afaict is at the bottom)
Code: Select all
Checking config...
PACKAGE_VERSION := TRUNK
MODE := release
DEVDIR := C:/devlib
Config seems valid.
Checking config...
PACKAGE_VERSION := TRUNK
MODE := release
DEVDIR := C:/devlib
Config seems valid.
bison -d -o message_parser.tab.c message_parser.y
gcc -I.. -DPACKAGE=\"warzone2100\" -DPACKAGE_VERSION=\"TRUNK\" -DYY_STATIC -IC:/
devlib/include/SDL -IC:/devlib/include/libpng12 -IC:/devlib/include/bfd -IC:/dev
lib/include -DNDEBUG -DWIN32 -DPACKAGE=\"warzone2100\" -DPACKAGE_VERSION=\"TRUNK
\" -DYY_STATIC -IC:/devlib/include/SDL -IC:/devlib/include/libpng12 -IC:/devlib/
include/bfd -IC:/devlib/include -DNDEBUG -DWIN32 -I../lib/ivis_opengl -std=gnu9
9 -g -Wall -Werror-implicit-function-declaration -std=gnu99 -g -Wall -Werror-imp
licit-function-declaration -c -o message_parser.tab.o message_parser.tab.c
In file included from ../lib/framework/string_ext.h:24:0,
from ../lib/framework/frame.h:39,
from message_parser.y:26:
../lib/framework/debug.h:55:13: error: expected '=', ',', ';', 'asm' or '__attri
bute__' before 'assertEnabled'
In file included from ../lib/framework/string_ext.h:24:0,
from ../lib/framework/frame.h:39,
from message_parser.y:26:
../lib/framework/debug.h:129:9: error: expected '=', ',', ';', 'asm' or '__attri
bute__' before '<' token
../lib/framework/debug.h:130:9: error: expected '=', ',', ';', 'asm' or '__attri
bute__' before '<' token
../lib/framework/debug.h:186:13: error: expected '=', ',', ';', 'asm' or '__attr
ibute__' before 'enabled_debug'
../lib/framework/debug.h:189:15: error: expected declaration specifiers or '...'
before '*' token
../lib/framework/debug.h:189:9: warning: type defaults to 'int' in declaration o
f 'bool'
../lib/framework/debug.h:189:9: error: 'bool' declared as function returning a f
unction
../lib/framework/debug.h:195:2: error: expected specifier-qualifier-list before
'debug_callback_init'
../lib/framework/debug.h:227:59: error: expected declaration specifiers or '...'
before 'debug_callback_init'
../lib/framework/debug.h:230:6: error: 'debug_callback_file_init' declared as fu
nction returning a function
../lib/framework/debug.h:244:6: error: 'debug_enable_switch' declared as functio
n returning a function
../lib/framework/debug.h:277:13: error: 'debugPartEnabled' declared as function
returning a function
In file included from ../lib/framework/frame.h:39:0,
from message_parser.y:26:
../lib/framework/string_ext.h: In function 'strlcpy':
../lib/framework/string_ext.h:103:2: error: function '_wzeval' is initialized li
ke a variable
../lib/framework/string_ext.h:103:2: warning: the address of '_wzeval' will alwa
ys evaluate as 'true'
../lib/framework/string_ext.h:103:2: error: 'assertEnabled' undeclared (first us
e in this function)
../lib/framework/string_ext.h:103:2: note: each undeclared identifier is reporte
d only once for each function it appears in
../lib/framework/string_ext.h:103:2: error: nested function '_wzeval' declared b
ut never defined
../lib/framework/string_ext.h:104:2: error: function '_wzeval' is initialized li
ke a variable
../lib/framework/string_ext.h:104:2: warning: the address of '_wzeval' will alwa
ys evaluate as 'true'
../lib/framework/string_ext.h:104:2: error: nested function '_wzeval' declared b
ut never defined
../lib/framework/string_ext.h: In function 'strlcat':
../lib/framework/string_ext.h:140:2: error: function '_wzeval' is initialized li
ke a variable
../lib/framework/string_ext.h:140:2: warning: the address of '_wzeval' will alwa
ys evaluate as 'true'
../lib/framework/string_ext.h:140:2: error: 'assertEnabled' undeclared (first us
e in this function)
../lib/framework/string_ext.h:140:2: error: nested function '_wzeval' declared b
ut never defined
../lib/framework/string_ext.h:141:2: error: function '_wzeval' is initialized li
ke a variable
../lib/framework/string_ext.h:141:2: warning: the address of '_wzeval' will alwa
ys evaluate as 'true'
../lib/framework/string_ext.h:141:2: error: nested function '_wzeval' declared b
ut never defined
In file included from ../lib/framework/frame.h:44:0,
from message_parser.y:26:
../lib/framework/i18n.h: At top level:
../lib/framework/i18n.h:54:13: error: 'setLanguage' declared as function returni
ng a function
In file included from ../lib/framework/frame.h:45:0,
from message_parser.y:26:
../lib/framework/trig.h:32:13: error: 'trigInitialise' declared as function retu
rning a function
In file included from message_parser.y:26:0:
../lib/framework/frame.h:71:13: error: 'frameInitialise' declared as function re
turning a function
In file included from message_parser.y:26:0:
../lib/framework/frame.h:117:8: error: expected identifier or '(' before string
constant
In file included from message_parser.y:26:0:
../lib/framework/frame.h:119:8: error: expected identifier or '(' before string
constant
In file included from message_parser.y:27:0:
../lib/framework/strres.h:46:13: error: 'strresLoad' declared as function return
ing a function
In file included from message_parser.y:28:0:
../lib/framework/frameresource.h:36:16: error: 'RES_BUFFERLOAD' declared as func
tion returning a function
../lib/framework/frameresource.h:39:16: error: 'RES_FILELOAD' declared as functi
on returning a function
In file included from message_parser.y:28:0:
../lib/framework/frameresource.h:84:13: error: 'resInitialise' declared as funct
ion returning a function
../lib/framework/frameresource.h:93:6: error: 'resLoad' declared as function ret
urning a function
../lib/framework/frameresource.h:105:13: error: 'resAddBufferLoad' declared as f
unction returning a function
../lib/framework/frameresource.h:109:13: error: 'resAddFileLoad' declared as fun
ction returning a function
../lib/framework/frameresource.h:113:13: error: 'resLoadFile' declared as functi
on returning a function
../lib/framework/frameresource.h:116:13: error: 'resAddData' declared as functio
n returning a function
../lib/framework/frameresource.h:121:13: error: 'resPresent' declared as functio
n returning a function
../lib/framework/frameresource.h:125:13: error: 'resGetHashfromData' declared as
function returning a function
In file included from ../lib/framework/vector.h:29:0,
from ../lib/ivis_opengl/pietypes.h:33,
from ../src/objectdef.h:28,
from ../src/structure.h:29,
from ../src/message.h:27,
from message_parser.y:29:
../lib/framework/math_ext.h:29:17: fatal error: cmath: No such file or directory
compilation terminated.
make: *** [message_parser.tab.o] Error 1
rm message_parser.tab.c
Although i only found the C version math.h inside "mingw/include", I had hoped that there might be some sort of automatic conversion into the C++ format; and if there wasn't, then why weren't the C++ standard headers included in my copy of gcc? Have I installed the wrong version somewhere?
I am sure I've missed something simple somewhere(and am sorry to waste people's time something probably quite simple); but not knowing what to look for, I have no idea what.
Someone please point out my mistake.
Thankyou