Jump to content

[Map/Grid] New Map/Terrain Management System


Guest XTZGZoReX

Recommended Posts

I just can't figure out why GCC won't compile it...

Could it be whitespace errors? When I opened your last offered patch, copied as plain text from Pastebin, with Notepad++, I turned on "Show Whitespace" and noticed that all the blanks lines used to separate code sections actually had a single space. Lines 21, 28, 48, 65, 69, 71, 84, 90, 92, 95, 105, 108, 113, 119, 129, ... and so on.

I don't know how GCC handles this, but it will cause whitespace errors for my setup, msysgit with TortoiseMerge and VC++ 9.0 Express SP1.

Link to comment
Share on other sites

  • Replies 60
  • Created
  • Last Reply

Top Posters In This Topic

Could it be whitespace errors? When I opened your last offered patch, copied as plain text from Pastebin, with Notepad++, I turned on "Show Whitespace" and noticed that all the blanks lines used to separate code sections actually had a single space. Lines 21, 28, 48, 65, 69, 71, 84, 90, 92, 95, 105, 108, 113, 119, 129, ... and so on.

I don't know how GCC handles this, but it will cause whitespace errors for my setup, msysgit with TortoiseMerge and VC++ 9.0 Express SP1.

That's probably not the issue, I'll take a look at it if Zor has it in his github repo.

edit: yes, it looks like some namespace issue

Link to comment
Share on other sites

Notice the difference: http://openpaste.org/en/20497/ (ending NULL doesn't really matter, I've tried to (ACE_Thread_Mutex*)NULL it, but the error obviously remained). The problem probably lies in the "reference".

Might be related to http://gcc.gnu.org/ml/gcc-help/2006-09/msg00322.html:

> I wonder if this is a known G++ limitation or issue ? Because the same

> program got compiled with VC8.

You were trying to get a reference to a temporary object by just calling

the constructor of MemAllocator where func expects a MemAllocator&.

The error message kind of contains this info as it says that it can't

find func(MemAllocator), note no reference.

A more intuitive error message would be nicer, I guess. E.g. icc9.1

tells you:

testKelvin.cpp(12): error: initial value of reference to non-const must

be an lvalue

Map::func((MemAllocator<int>) (MemAllocator<int>()));

And Comeau (http://www.comeaucomputing.com/tryitout/) says the exact

same thing (hmm, is icc using the EDG front-end now?)

Note that even if VC8 decided to compile this code it most likely

wouldn't work properly. OTOH maybe you meant to pass a const ref anyway?

edit: btw; The performance gain from map preloading won't be THAT much, .. since most modern OSes use free RAM for block-level (LBA) disk cache. It will be somewhat faster (no additional layers, no extensive in-memory copies, ...), but it won't be really that much.

Link to comment
Share on other sites

Thanks for taking a look at it, freghar. I was hoping it would be something a simple as Pastebin adding whitespace into the diff, but I have faith that all you coding wizards will have it sorted soon. There's an awesome amount of brain power behind this whole community! I just wish this patch had proven to be less problematic because it showed such great promise, and then there's the news that performance improvements may be marginal, at best. I'm hoping that will change as the code is further refined.

Side note: While "googling" for some more info on this issue with GCC and the ICC reference quoted by you, I noticed that Intel finally offers its compilers and some libraries as freeware for Linux!

Link to comment
Share on other sites

Side note: While "googling" for some more info on this issue with GCC and the ICC reference quoted by you, I noticed that Intel finally offers its compilers and some libraries as freeware for Linux!

Sure, mangos uses intel's TBB library to speedup windows allocations (for example). ICC compiler isn't as cool as it might look like, it negatively (and intentionally - proven) affects non-Intel CPUs.

Link to comment
Share on other sites

Don't you just love the cut-throat methods of the software industry? In other commercial fields, such practices would be considered a crime here in the U.S.A. under the racketeering laws. lol

It's not that I think the Intel compilers are all that great, but I am honestly surprised that a company like Intel would offer up their programming tools for free under any circumstance. I'd say that counts as another victory for the open source movement, who also led Microsoft into creating freeware versions of its numerous programming software and libraries.

So many developers are excited about open source software development, that I'm sure MS and Intel were afraid of losing some of their grip on the coders. It's just too bad their paranoia about profit and copyrights led them to implement limits and crippled functionality, which makes GCC and other open source tools even more appealing. For Windows, I think Open Watcom would be the best choice for those who want an IDE, plus it's a very good compiler with a commercial history that made Microsoft's early attempts at C++ look amateur.

Apologies for wandering so far off the trail here, but I enjoy conversing with you, freghar, and I learn something valuable from you every time. :)

Link to comment
Share on other sites

  • 1 month later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use