Code::Blocks and mingw issues

Trying to build your own version of Vega Strike and having problems? Unix users, paste your config.log here (stderr output alone is not helpful).
Post Reply
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Code::Blocks and mingw issues

Post by shenle »

After getting C::B plus VC 2003 toolkit to compile vegastrike, now I'm trying to get it to compile with mingw (because the legality of redistributing the VC toolkit is dubious...)

I am using the same vega-vc7 project as a starting point. I have had some limited success initially, getting over things like mingw not finding certain headers, or replacing headers that are VC++ specific with their mingw equivalents.

Currently I am stuck at:

Code: Select all

Compiling: ..\vegastrike\src\VSFileXMLSerializer.cpp
In file included from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.h:5,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:83: error: `stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:83: error: expected initializer before '<' token
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:84: error: `FileLookupCache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:84: error: `cache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:84: error: expected primary-expression before "const"
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:84: error: expected primary-expression before "type"
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:84: error: initializer expression list treated as compound expression
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:132: error: `stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\vsfilesystem.h:132: error: expected initializer before '<' token
Process terminated with status 1 (0 minutes, 1 seconds)
9 errors, 0 warnings
The code around the lines in question is

Code: Select all

typedef vsUMap< string, VSError >FileLookupCache;
VSError CachedFileLookup( FileLookupCache &cache, const string &file, VSFileType type );
and

Code: Select all

extern vsUMap< string, CPK3* >pk3_opened_files;                           
(just before this cropped out, I had problems with mingw not finding hash_map, which is located at mingw/include/c++/3.4.5/ext)
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

Oh no... The hash_map problem again.
This is a long story: There were many flavors of hash_map at one time. It was not part of the official STL, so each STL source had its own version, which were all incompatible. I worked with SGI's hash_map, at one time; but had trouble porting my code to STLPort, even though it was based on SGI's STL.
Anyways, eventually BOOST tackled hash_map, and now there's a standard STL specification for it, but it changed names: Now it's called "unordered_map", and I think the engine uses it. So, I don't understand why it's asking for an stdext namespace. It should be looking for unordered_map under namespace std.
Something is wrong, but I've no idea what. We should get rid of all traces of hash_map and any compile options that reference it.

EDIT:
But if you find it and delete it or edit it, keep in mind that the engine does need hash_somethingelse (hash_table?, gnu_hash?), which it uses for a custom-coded "3D hash-map"; so don't grep hash * | rm {} or something like that.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

Well I'll tell you exactly where the hash_map issue appeared. In src/gnuhash.h.

Code: Select all

#ifdef _WIN32
#ifdef HAVE_TR1_UNORDERED_MAP
#include <unordered_map>  //MSVC doesn't use tr1 dirs
#else
#include <hash_map>
#endif
#else //#ifdef _WIN32 { ... } else ...
#if __GNUC__ == 2
#include <map>
#define hash_map map
#define stdext std
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

Try,

Code: Select all

#ifdef _WIN32
#if 1 //def HAVE_TR1_UNORDERED_MAP
#include <unordered_map>  //MSVC doesn't use tr1 dirs
#else
#include <hash_map>
#endif
#else //#ifdef _WIN32 { ... } else ...
.................
See if that fixes it.
If not, you could look through the VCC folders, see if you can find where it is...
Wait, VC7 probably doesn't have it.
You could try copying unordered_map from VC8 probably.
I'm not sure.
Or it might work with hash_map, but then you'd have to see where VC7 declares it, if you get the error that stdext is not defined; that's where I would have expected hash_map to be; but maybe VC7 put it into some "ms_ext" :), who knows...
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

The VC 2003 toolkit does have hash_map in /include

And no, it does not fix anything because I don't have unordered_map anywhere... :(
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

Okay, since VC7 doesn't have unordered_map, and you were able to compile a binary before, we can conclude that you built a binary that uses hash_map, and that it worked.
So, now the question is, why doesn't this work with code::blocks?
Why is stdext missing?
I'd suggest you post a question at a code::blocks users newsgroup or forum.
Maybe you need STLPort or something.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

What I ended up doing is update my mingw installation from gcc-3.4.5 to gcc-4.4.0 which includes unordered_map instead of hash_map.

Now what I get is:

Code: Select all

Compiling: ..\vegastrike\boost\1_35\src\converter\arg_to_python_base.cpp
Compiling: ..\vegastrike\boost\1_35\src\converter\builtin_converters.cpp
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:22,
                 from ..\vegastrike\boost\1_35/boost/mpl/aux_/comparison_op.hpp:27,
                 from ..\vegastrike\boost\1_35/boost/mpl/equal_to.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/meta.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_cast_utils.hpp:18,
                 from ..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:25,
                 from ..\vegastrike\boost\1_35/boost/mpl/aux_/comparison_op.hpp:27,
                 from ..\vegastrike\boost\1_35/boost/mpl/equal_to.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/meta.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/comparison_op.hpp:27,
                 from ..\vegastrike\boost\1_35/boost/mpl/equal_to.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/meta.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:290:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:22,
                 from ..\vegastrike\boost\1_35/boost/mpl/aux_/arithmetic_op.hpp:26,
                 from ..\vegastrike\boost\1_35/boost/mpl/times.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/mpl/multiplies.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/is_subranged.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:21,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegas
trike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/arithmetic_op.hpp:26,
                 from ..\vegastrike\boost\1_35/boost/mpl/times.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/mpl/multiplies.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/is_subranged.hpp:17,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:21,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:290:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:22,
                 from ..\vegastrike\boost\1_35/boost/mpl/aux_/comparison_op.hpp:27,
                 from ..\vegastrike\boost\1_35/boost/mpl/less.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/is_subranged.hpp:18,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:21,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:81:31: error: missing binary operator before token "("
..\vegastrike\boost\1_35/boost/mpl/apply_wrap.hpp:173:31: error: missing binary operator before token "("
In file included from ..\vegastrike\boost\1_35/boost/mpl/aux_/comparison_op.hpp:27,
                 from ..\vegastrike\boost\1_35/boost/mpl/less.hpp:19,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/is_subranged.hpp:18,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/detail/conversion_traits.hpp:21,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/conversion_traits.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/converter.hpp:13,
                 from ..\vegastrike\boost\1_35/boost/numeric/conversion/cast.hpp:32,
                 from ..\vegastrike\boost\1_35/boost/cast.hpp:105,
                 from D:\dls\vegastrike\svn\vegastrike\boost\1_35\src\converter\builtin_converters.cpp:21:
..\vegastrike\boost\1_35/boost/mpl/aux_/numeric_op.hpp:290:31: error: missing binary operator before token "("
Process terminated with status 1 (0 minutes, 21 seconds)
11 errors, 0 warnings
The offending code is:

Code: Select all

#elif BOOST_PP_ITERATION_DEPTH() == 1
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

shenle wrote:What I ended up doing is update my mingw installation from gcc-3.4.5 to gcc-4.4.0 which includes unordered_map instead of hash_map.
Good!
I'm running gcc-4.4.1 with no problems.

So, some ugly boost python wrapper macro seems to have set gcc's head spinning.
What I don't know is why I don't get the same problem.

Well, I had all kinds of problems with boost 1.35; I'm compiling now with boost 1.4 I think... Yep; 1.40.
With autotools we got a configure switch "--with-boost=system"; but in windows there's no system to speak of...
But I think you could try pulling 1.40; I'm not sure why we have 1.35 as default.
There may be another issue: Ubuntu sanitize boost before they package it...; but I think it's a good bet
with 1.40 the problem might evaporate.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

I have actually downloaded boost 1.42 and am trying to replace 1.35 with it. Given that I'm not a programmer by trade, it may take me a while to figure out how.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

So I did the quick and dirty thing and... uhh... copied over the relevant files from boost 1.42 over the 1.35 ones. (hangs head in shame)

Now boost compiles cleanly with mingw/gcc-4.4.0. But I'm still stuck at stdext.

Code: Select all

Compiling: ..\vegastrike\src\VSFileXMLSerializer.cpp
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/backward/hash_map:59,
                 from ..\vegastrike\src/gnuhash.h:28,
                 from D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:14,
                 from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:5,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
In file included from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:5,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: 'stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: expected initializer before '<' token
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'FileLookupCache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'cache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'const'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'type'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: initializer expression list treated as compound expression
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: 'stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: expected initializer before '<' token
Process terminated with status 1 (1 minutes, 59 seconds)
9 errors, 6 warnings
(edit)
I applied your "fix" from above to force it to use unordered_map instead of hash_map, and got an error telling me that feature is experimental and needs to be explicitly enabled in gcc. I did that by adding '-std=c++0x' to the compiler options, but now I get this:

Code: Select all

Compiling: ..\vegastrike\src\VSFileXMLSerializer.cpp
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/char_traits.h:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/string:42,
                 from D:\dls\vegastrike\svn\vegastrike\src\/XMLDocument.h:4,
                 from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:4,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared
In file included from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:5,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: 'stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: expected initializer before '<' token
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'FileLookupCache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'cache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'const'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'type'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: initializer expression list treated as compound expression
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: 'stdext' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: expected initializer before '<' token
Process terminated with status 1 (0 minutes, 1 seconds)
11 errors, 0 warnings
So it looks like the hash_map/unordered_map and undeclared stdext are 2 distinct issues.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

R.E. -std=c++0x, excellent!

So now you got unordered_map<>, so hash_map<> should be out of your face for good.

Now, in vsfilesystem.h, line 83 is

Code: Select all

typedef vsUMap< string, VSError > FileLookupCache;
and line 132 is,

Code: Select all

extern vsUMap< string, CPK3* >pk3_opened_files; //Map of the currently opened PK3 volume/resource files
It looks like vsUMap, whatever the heck that is, doesn't like std::string, for some reason.
Maybe it doesn't have a hash function for std::string?
What the heck IS vsUmap, anyways?

BTW, vsfilesystem.h has a

Code: Select all

#include <string>
but it also has a,

Code: Select all

#include "pk3.h"
Now, pk3.h has a,

Code: Select all

#include <string.h>
Not a good idea to mix headers with and without .h extensions; possible name conflicts when one considers
the use of using namespace std, which usually comes with complete abandon, though lately it's been tamed..
But I tried to change <string.h> to <string> and I get more error messages than there's lines of code.
Figures...

Well, vsUMap is a bloody macro in gnuhash.h:

Code: Select all

#ifdef HAVE_TR1_UNORDERED_MAP
#define vsUMap std::tr1::unordered_map
#define vsHashComp std::tr1::hash_compare
#define vsHash std::tr1::hash
#else
#define vsUMap stdext::hash_map
#define vsHashComp stdext::hash_compare
#define vsHash stdext::hash
#endif
So, the problem is you somehow got unordered_map, but HAVE_TR1_UNORDERED_MAP is not defined.
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

Hm. Where should HAVE_TR1_UNORDERED_MAP come from? The OS? I somehow don't think Windows knows/cares about unordered_map. Code::Blocks? Mingw configuration?
make me a sandwich
make: *** No rule to make target 'me'. Stop.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Code::Blocks and mingw issues

Post by klauss »

There's a config.h include file in VC project folders that defines all that stuff.

The latest #defines should be added there, like NV_CUBE_MAP, TR1 stuff, etc...
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

I added HAVE_TR1_UNORDERED_MAP to the compiler #defines in C::B. Here's the new batch of errors:

Code: Select all

Compiling: ..\vegastrike\src\VSFileXMLSerializer.cpp
In file included from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/char_traits.h:42,
                 from c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/string:42,
                 from D:\dls\vegastrike\svn\vegastrike\src\/XMLDocument.h:4,
                 from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:4,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
c:\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared
In file included from D:\dls\vegastrike\svn\vegastrike\src\/VSFileXMLSerializer.h:5,
                 from D:\dls\vegastrike\svn\vegastrike\src\VSFileXMLSerializer.cpp:1:
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: 'std::tr1' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:83: error: expected initializer before '<' token
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'FileLookupCache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: 'cache' was not declared in this scope
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'const'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: expected primary-expression before 'type'
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:84: error: initializer expression list treated as compound expression
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: 'std::tr1' has not been declared
D:\dls\vegastrike\svn\vegastrike\src\/vsfilesystem.h:132: error: expected initializer before '<' token
Process terminated with status 1 (0 minutes, 1 seconds)
11 errors, 0 warnings
Argh.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

Arg is right. WTF? Why wouldn't std::tr1 not be defined, when you got tr1?
You added the defines that Klauss suggested, right?
shenle
Confed Special Operative
Confed Special Operative
Posts: 381
Joined: Thu Jan 31, 2008 3:25 am
Location: hiding in a dark corner

Re: Code::Blocks and mingw issues

Post by shenle »

chuck_starchaser wrote:Arg is right. WTF? Why wouldn't std::tr1 not be defined, when you got tr1?
You added the defines that Klauss suggested, right?
Is that vega-vc7/include/config.h? No, I didn't put it there as a #define, I added it to the list of compiler #defines in Code::Blocks. Which should do the same job, after all it did get unordered_map recognized and loaded.
make me a sandwich
make: *** No rule to make target 'me'. Stop.
chuck_starchaser
Elite
Elite
Posts: 8014
Joined: Fri Sep 05, 2003 4:03 am
Location: Montreal
Contact:

Re: Code::Blocks and mingw issues

Post by chuck_starchaser »

Donno. I'm at a loss. Check the STL library you have; look for where unordered_map is declared/defined; verify it's in a namespace tr1, within namespace std. It should be, but if the linker says it's not defined, maybe it's not. Maybe it's named something else.
Post Reply