Jump to content

compilation error on mac osx 10.6.4


aeno
 Share

Recommended Posts

hi everyone,

i'm trying to compile 0ad under mac osx 10.6.4 snow leopard. i installed all the macports prerequisites successfully but when i try to "make" i get two errors in "network":

==== Building mocks_real ====
make[1]: `../../../binaries/system/libmocks_real_dbg.a' is up to date.
==== Building network ====
mkdir -p obj/network_Debug
/usr/bin/g++-4.2 -MMD -D "LIB_STATIC_LINK" -D "DEBUG" -D "USING_PCH" -I "/usr/X11R6/include/X11" -I "/usr/X11R6/include" -I "/usr/include/X11" -I "../../../source/pch/network" -I "../../../source/" -I "../../../libraries/spidermonkey-tip/include-unix/debug" -I "/opt/local/include" -g -Wall -Wno-switch -Wno-reorder -Wno-invalid-offsetof -Wextra -Wno-missing-field-initializers -Wunused-parameter -Wredundant-decls -Wnon-virtual-dtor -Wundef -fstack-protector-all -D_FORTIFY_SOURCE=2 -fstrict-aliasing -fpch-preprocess -msse -fno-omit-frame-pointer -fvisibility=hidden -MF obj/network_Debug/NetClient.d -MT obj/network_Debug/NetClient.o -o obj/network_Debug/NetClient.o -c -include obj/network_Debug/precompiled.h ../../../source/network/NetClient.cpp
In file included from ../../../source/ps/CConsole.h:30,
from ../../../source/network/NetClient.cpp:27:
../../../source/lib/file/vfs/vfs_path.h:68: error: ‘is_basic_path’ is not a template
../../../source/lib/file/vfs/vfs_path.h:69: error: explicit specialization of non-template ‘boost::filesystem::is_basic_path’
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: *** [obj/network_Debug/NetClient.o] Error 1
make: *** [network] Error 2

has anyone a clue why that error occurs?

thanks for all your help,

aeno

Link to comment
Share on other sites

I've upgrade to the new revision but i've the same kinf of error during compilation.

I don't understand the patch, i think. I've add the 3 lines in the source file, that's it ?

EDIT : it seems to be working. Thanks Karlik ! I've missed the # in the patch.

But i've some warning : "dereferencing type-punned pointer will break strict-aliasing rules".

Is the command "sudo" necessary before "make" or not ?

(Excuse my language, i'm french.) =/

Edited by Rorto
Link to comment
Share on other sites

I've tried with archive of the latest release instead of SVN files. (http://trac.wildfiregames.com/wiki/LatestRelease)

So during building lowlevel :

../../../source/lib/sysdep/cpu.cpp:38: error: invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’
../../../source/lib/sysdep/cpu.cpp:38: error: initializing argument 1 of ‘bool cpu_CAS(volatile intptr_t*, intptr_t, intptr_t)’
../../../source/lib/sysdep/cpu.cpp: At global scope:
../../../source/lib/sysdep/cpu.cpp:30: warning: ‘LINE_30_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:31: warning: ‘LINE_31_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:32: warning: ‘LINE_32_2’ defined but not used
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: *** [obj/lowlevel_Debug/cpu.o] Error 1
make: *** [lowlevel] Error 2

Thanks for your help.

Link to comment
Share on other sites

It looks ARCH_AMD64 is defined to 1 and i64 and intptr_t aren't the same.

Can you please verify this by (temporarily) adding something like


#if ARCH_AMD64 == 1
#error "arch is 64, remove me"
#endif
#if sizeof(i64) != sizeof(intptr_t)
#error "size mismatch, remove me"
#endif

in cpu.cpp?

The next question is of course: why and how is intptr_t defined? It should be the same size as a pointer, or else all kinds of stuff will break.

Link to comment
Share on other sites

After adding your code to cpu.cpp, the error is :

cpu.cpp
../../../source/lib/sysdep/cpu.cpp:57:2: error: #error "arch is 64, remove me"
../../../source/lib/sysdep/cpu.cpp:59:5: warning: "sizeof" is not defined
../../../source/lib/sysdep/cpu.cpp:59:11: error: missing binary operator before token "("
../../../source/lib/sysdep/cpu.cpp: In function ‘void TestCAS64()’:
../../../source/lib/sysdep/cpu.cpp:38: error: invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’
../../../source/lib/sysdep/cpu.cpp:38: error: initializing argument 1 of ‘bool cpu_CAS(volatile intptr_t*, intptr_t, intptr_t)’
../../../source/lib/sysdep/cpu.cpp: At global scope:
../../../source/lib/sysdep/cpu.cpp:30: warning: ‘LINE_30_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:31: warning: ‘LINE_31_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:32: warning: ‘LINE_32_2’ defined but not used
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: *** [obj/lowlevel_Release/cpu.o] Error 1
make: *** [lowlevel] Error 2

So i've removed

#if ARCH_AMD64 == 1
#error "arch is 64, remove me"
#endif

And the error is :

==== Building mocks_test ====
../../../source/lib/sysdep/cpu.cpp:57:5: warning: "sizeof" is not defined
../../../source/lib/sysdep/cpu.cpp:57:11: error: missing binary operator before token "("
../../../source/lib/sysdep/cpu.cpp: In function ‘void TestCAS64()’:
../../../source/lib/sysdep/cpu.cpp:38: error: invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’
../../../source/lib/sysdep/cpu.cpp:38: error: initializing argument 1 of ‘bool cpu_CAS(volatile intptr_t*, intptr_t, intptr_t)’
../../../source/lib/sysdep/cpu.cpp: At global scope:
../../../source/lib/sysdep/cpu.cpp:30: warning: ‘LINE_30_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:31: warning: ‘LINE_31_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:32: warning: ‘LINE_32_2’ defined but not used
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: `../../../binaries/system/libmocks_test.a' is up to date.
==== Building AtlasObject ====
make[1]: *** [obj/lowlevel_Release/cpu.o] Error 1
make: *** [lowlevel] Error 2

I don't understand anything. =/

But thanks for the help. ^^

Edited by Rorto
Link to comment
Share on other sites

OK, thanks. We now know that our predefined macros believe your system to be 64 bit ;)

Unfortunately I screwed up the latter half of that snippet - `sizeof' isn't known to the preprocessor, oops.

Instead, we need to add an actual line of code somewhere that is sure to run, e.g. as the first line within main() in main.cpp:

debug_printf(L"here are the sizes: %d %d %d\n", sizeof(int), sizeof(void*), sizeof(intptr_t));

Those 3 numbers should then be displayed somewhere in the console/terminal - can you please post them?

Link to comment
Share on other sites

With the last rev (8078) i've :

==== Building atlas ====
make[1]: *** No rule to make target `../../../source/graphics/TextureEntry.h', needed by `obj/graphics_Release/GameView.o'. Stop.
make: *** [graphics] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** No rule to make target `../../../source/graphics/TextureManager.h', needed by `obj/engine_Release/GameSetup.o'. Stop.
make[1]: *** Waiting for unfinished jobs....
World.cpp
make[1]: *** No rule to make target `../../../source/graphics/TextureEntry.h', needed by `obj/atlas_Release/ActorViewer.o'. Stop.
make: *** [atlas] Error 2
In file included from ../../../source/ps/World.cpp:33:
../../../source/lib/timer.h: In member function ‘void TimerUnit::AddDifferenceAtomic(TimerUnit, TimerUnit)’:
../../../source/lib/timer.h:178: warning: dereferencing type-punned pointer will break strict-aliasing rules
make: *** [engine] Error 2

And with your line it's :

make[1]: *** No rule to make target `../../../source/graphics/TextureManager.h', needed by `obj/engine_Release/GameSetup.o'.  Stop.
make: *** [engine] Error 2
make: *** Waiting for unfinished jobs....
make[1]: `../../../binaries/system/libi18n.a' is up to date.
make[1]: *** No rule to make target `../../../source/graphics/TextureEntry.h', needed by `obj/graphics_Release/GameView.o'. Stop.
make: *** [graphics] Error 2

Exept if I was wrong with main.cpp. Should he looks like that ?

int main(int argc, char* argv[])
{
EarlyInit(); // must come at beginning of main
debug_printf(L"here are the sizes: %d %d %d\n", sizeof(int), sizeof(void*), sizeof(intptr_t));

RunGameOrAtlas(argc, const_cast<const char**>(argv));

return EXIT_SUCCESS;
}

I'm really lost. =/

Link to comment
Share on other sites

You need to run "make clean" and run update-workspaces.sh again, after updating from SVN, if any source files have been added or deleted recently (which they have). That will fix the "No rule to make target" errors. (I expect you'll still get the "invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’" errors, though.)

Link to comment
Share on other sites

#535 has some information from Bob who had a similar problem.

Aha! 64-bit, even though the system is 32-bit? Is that the case here? (Wasn't commented upon above)

Adding lines of code to run doesn't sound very helpful when the problem is the game won't build...

heh, it'll also work, just need to comment out everything that causes a compile error.

Your cassert idea is simpler still, though. I've added those sanity checks to cpu.cpp, can't hurt.

Exept if I was wrong with main.cpp. Should he looks like that ?

The debug_printf really should be the very first thing (that comment notwithstanding), but it is no longer needed.

Instead, the new casserts in cpu.cpp will probably explode - what messages are you getting?

(I'm still not sure whether the problem is an inadvertant definition of ARCH_AMD64 or incorrect definition of intptr_t)

Link to comment
Share on other sites

I've delete my old copy and download a new one.

During ==== Building wxJS ==== the error is :

cpu.cpp
../../../source/lib/sysdep/cpu.cpp: In function ‘void TestCAS64()’:
../../../source/lib/sysdep/cpu.cpp:51: error: invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’
../../../source/lib/sysdep/cpu.cpp:51: error: initializing argument 1 of ‘bool cpu_CAS(volatile intptr_t*, intptr_t, intptr_t)’
In file included from /opt/local/include/wx-2.8/wx/html/helpdata.h:21,
from /opt/local/include/wx-2.8/wx/html/helpfrm.h:20,
from /opt/local/include/wx-2.8/wx/html/helpctrl.h:20,
from /opt/local/include/wx-2.8/wx/help.h:36,
from /opt/local/include/wx-2.8/wx/cshelp.h:19,
from ../../../source/tools/atlas/wxJS/gui/control/helpbtn.h:28,
from ../../../source/tools/atlas/wxJS/gui/gui_init.cpp:82:
/opt/local/include/wx-2.8/wx/filesys.h: In member function ‘wxFSHandlerHash_wxImplementation_HashTable::Node** wxFSHandlerHash_wxImplementation_HashTable::GetNodePtr(const void* const&) const’:
/opt/local/include/wx-2.8/wx/filesys.h:176: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../../source/lib/sysdep/cpu.cpp: At global scope:
../../../source/lib/sysdep/cpu.cpp:30: warning: ‘LINE_30_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:31: warning: ‘LINE_31_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:32: warning: ‘LINE_32_2’ defined but not used
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: *** [obj/lowlevel_Release/cpu.o] Error 1
make: *** [lowlevel] Error 2
make: *** Waiting for unfinished jobs....

(too long ?)

Link to comment
Share on other sites

hm, interesting. Line 51 is the new location of the cpu_CAS64 call, so it looks like those casserts are not failing. Apparently what is happening is that intptr_t and i64 aren't actually the same type, so GCC refuses to cast.

I have now removed the cpu_CAS64 wrapper. Code that always wants to write 64 bits (regardless of pointer size) will now need to call ia32_asm_CAS64 #if ARCH_IA32, which isn't too bad since it's only 2 spots.

That should fix it - can you confirm?

(BTW, mention of wxJS is unrelated - it was probably compiling that in parallel.)

Link to comment
Share on other sites

Now (rev8080) i've : (the same, no ?)

cpu.cpp
../../../source/lib/sysdep/cpu.cpp: In function ‘void TestCAS64()’:
../../../source/lib/sysdep/cpu.cpp:51: error: invalid conversion from ‘volatile int64_t*’ to ‘volatile intptr_t*’
../../../source/lib/sysdep/cpu.cpp:51: error: initializing argument 1 of ‘bool cpu_CAS(volatile intptr_t*, intptr_t, intptr_t)’
In file included from /opt/local/include/wx-2.8/wx/html/helpdata.h:21,
from /opt/local/include/wx-2.8/wx/html/helpfrm.h:20,
from /opt/local/include/wx-2.8/wx/html/helpctrl.h:20,
from /opt/local/include/wx-2.8/wx/help.h:36,
from /opt/local/include/wx-2.8/wx/cshelp.h:19,
from ../../../source/tools/atlas/wxJS/gui/control/helpbtn.h:28,
from ../../../source/tools/atlas/wxJS/gui/gui_init.cpp:82:
/opt/local/include/wx-2.8/wx/filesys.h: In member function ‘wxFSHandlerHash_wxImplementation_HashTable::Node** wxFSHandlerHash_wxImplementation_HashTable::GetNodePtr(const void* const&) const’:
/opt/local/include/wx-2.8/wx/filesys.h:176: warning: dereferencing type-punned pointer will break strict-aliasing rules
../../../source/lib/sysdep/cpu.cpp: At global scope:
../../../source/lib/sysdep/cpu.cpp:30: warning: ‘LINE_30_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:31: warning: ‘LINE_31_2’ defined but not used
../../../source/lib/sysdep/cpu.cpp:32: warning: ‘LINE_32_2’ defined but not used
/opt/local/include/boost/system/error_code.hpp:214: warning: ‘boost::system::posix_category’ defined but not used
/opt/local/include/boost/system/error_code.hpp:215: warning: ‘boost::system::errno_ecat’ defined but not used
/opt/local/include/boost/system/error_code.hpp:216: warning: ‘boost::system::native_ecat’ defined but not used
make[1]: *** [obj/lowlevel_Release/cpu.o] Error 1
make: *** [lowlevel] Error 2
make: *** Waiting for unfinished jobs....

and many things like that :

ld: warning: in /opt/local/lib/libxml2.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: duplicate dylib /opt/local/lib/libz.1.dylib
ld: in /opt/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

Edited by Rorto
Link to comment
Share on other sites

Impossible ;) r8080 is the newer version of that file, yes. However, the offending function call moved down a few lines, it's no longer on line 51. You must be compiling an older version still - did you do make clean here as well?

The ld warnings also indicate something is very wrong with your build system. Unfortunately I can't help there, never done any dev work on OS X :/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...