odd linker error on build of open gl app + libraries for game framework

4 posts / 0 new
Last post
Jason Wraxall
wjase's picture
Offline
Joined: 20 May 2011
Posts:
odd linker error on build of open gl app + libraries for game framework

Hi There,

I've been porting the Moai Opengl game framework to Mosync and have whittled the 3000 odd errors down to the following handful - but don't know how to get round these...

I've been building a lua runtime + 3rd party libs for Box2D physics and Moai as a lib.
I'm now trying to put together a Moai runtime host which combines the Moai game api with the capabilities of the Mosyn Lua API... I'm close...

Any ideas wecome,

Cheers,

Jason Wraxall

The duplicate symbol is a static contained in a templated method defined in a header.

	//----------------------------------------------------------------//
	template < typename TYPE >
	static RTTIRecord& Get () {
		static RTTIRecord single;
		return single;
	}

The data section errors are pointing to a line comtaining comments???
I saw an earlier post which mentioned Ming gcc getting in the way so I've checked the env path, and also renamed the ming folder to ensure it isn't being called... any other ideas or switches I can use to get some more diagnostics?

C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: Symbol '__ZGVZN10RTTIRecord3GetI13MOAILuaObjectEERS_vE6single' is already defined, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: illegal alignref outside data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: illegal alignref outside data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: illegal alignref outside data section, 
C:\data\code\cpp\moai-moai-beta-4d876f4\src\moaicore\MOAIVertexFormat.cpp:39: Error: data word in not in data section, 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Jason, very cool idea.

I don't know what your problem is specifically, but I know what it isn't. Its not that code you've posted above. These errors are typical of the MoSync build engine when it is trying to reference something its not been able to address. It is making its best attempt, but the link to line 39 is meaningless. You are going to have to go through the code logically.

Is this error occuring right at the end of the build process? My best guess is that it is, and the linker is having trouble. It looking for an address in the data section of the memory the runtime will consume, and the values don't match up. This is probably because there is an address value which hasn't been initialised in the code (e.g. int num; rather than int num = 0;) and the unassigned address is a random number. Its better that you've got this as a compilation problem rather than as a random runtime error.

I don't think that there is a quick way to work out what is wrong, but some of the big brains in Stockholm may be able to help trace the linker to find what the symbol with the illegal value is.

Jason Wraxall
wjase's picture
Offline
Joined: 20 May 2011
Posts:

Hi Sam,

Thanks for the feedback. What compiler / linker flags do you suggest I use to set to ferret out the root cause?

Cheers,

Jason

Jason Wraxall
wjase's picture
Offline
Joined: 20 May 2011
Posts:

Hi Again,

Sorry - I realised I hadn't answered you question - yes - the error occurs right at the end of the link process for the opengl moblet app which links to the already built moai lib... hope that helps...

Jason