BlitzMax 1.48 undefined reference to `__umoddi3'

BlitzMax Forums/BlitzMax Programming/BlitzMax 1.48 undefined reference to `__umoddi3'

Afke(Posted 2012) [#1]
Hi,

Can someone help me to solve error msg:

C:/BlitzMax/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x355): undefined reference to `__umoddi3'


pantson.Theora v2.2 Mod BlitzMax 1.48 ,everithing else works fine

Thanks,


xlsior(Posted 2012) [#2]
Did you try to recompile the module?

What version of MinGW are you using? (I'm assuming you're on windows?)


Afke(Posted 2012) [#3]
Hi,

Sorry for delay.


I tried with few MinGW versions ,and yes of course I recompile the modules with new version and copy :( ar.exe , ld.exe and libraries ) from MinGW to BlitzMax.
The problem is with pantson.Theora v2.2 because BlitzMax 1.48 use recent Version of MinGW .

I don't know how to solve this problem ,I will be grateful for any help.

Thanks

Last edited 2012


grable(Posted 2012) [#4]
Its a 64-bit MOD, for hardware without direct support.
The suggested fix is to link to libgcc.a as well.


xlsior(Posted 2012) [#5]
I double-checked mine, and it worked fine under blitzmax 1.48, GCC 4.6.1, under windows 7 x64 -- however, it turned out that I was still had pantson.theora v2.1 installed instead of 2.2

Download the 2.2 version -- compiled just fine, but it seems that the download didn't include the .bmx sample code that came with the older version... The old samples ran just fine for me using the 2.2 module, though.

So... No idea what is causing the problems for you, but at least it does look like the 2.2 module and blitzmax 1.48 -are able to work together OK...


Afke(Posted 2012) [#6]
Thank you guys for your help I will try GCC 4.61 , my game is Multi threaded .


Afke(Posted 2012) [#7]
I still don't have luck with it :(

Blitzmax 1.48, GCC 4.6.1, under windows 7 x64 pantson.theora 2.2
I get errors when I try to run play.bmx example

C:/BlitzMax/lib/libmingwex.a(pformat.o): In function `_pformat_int':
C:\MinGW\msys\1.0\src\mingwrt\mingwex/../../mingw/mingwex/stdio/pformat.c:496: undefined reference to `__umoddi3'
C:\MinGW\msys\1.0\src\mingwrt\mingwex/../../mingw/mingwex/stdio/pformat.c:497: undefined reference to `__udivdi3'
C:/BlitzMax/lib/libmingwex.a(pformat.o): In function `_pformat_xint':
C:\MinGW\msys\1.0\src\mingwrt\mingwex/../../mingw/mingwex/stdio/pformat.c:595: undefined reference to `__chkstk'
C:/BlitzMax/lib/libmingwex.a(pformat.o): In function `_pformat_emit_radix_point':
C:\MinGW\msys\1.0\src\mingwrt\mingwex/../../mingw/mingwex/stdio/pformat.c:901: undefined reference to `__chkstk'
Build Error: Failed to link C:/BlitzMax/mod/pantson.mod/project/play.exe

Last edited 2012


xlsior(Posted 2012) [#8]
Where did you download your version of MinGW?

this is the one I'm using (which was the version last recommended by BRL) http://www.xlsior.org/temp/mingw-7.2.exe

(Remember to recompile all modules if you switch MinGW releases, or you may run into issues)


Afke(Posted 2012) [#9]
Thanks, I will try again with your link .

I am recompiling :) Thanks again.


Afke(Posted 2012) [#10]
Well,

I Install fresh copy of Blitzmax 1.48 and mingw-7.2.exe and pantson.theora 2.2

It compiles fine but when I run example

I got this error msg :

C:/BlitzMax/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x355): undefined reference to `__umoddi3'
Build Error: Failed to link C:/BlitzMax/mod/pantson.mod/project/play.exe

Which samples do you run ?


Import pantson.theora

Graphics 1024,768,32

PlayTheora("Elephants_Dream_1024.ogv",0,0,1024,768,True)


Last edited 2012

Last edited 2012


xlsior(Posted 2012) [#11]
That's the same sample I ran, no error here...

Noticed that the headers still claim it's theora 2.1, though, although I'm almost certain that it's the 2.2 download.

Just in case, here's a copy of my zipped up pantson.mod folder...
http://www.xlsior.org/temp/pantson.mod.zip


Afke(Posted 2012) [#12]
Thanks man,

I really don't understand what I am doing wrong again same error msg .We are using same versions,it looks like everything is same ,but didn't work again for me.

Could you please send me your libmingwex.a please just to eliminate that possibility.


BlitzSupport(Posted 2012) [#13]
Think I've got it... I initially got the same error on 64-bit Win7 (even with just the Import panston.theora line), but after much Googling, perusing of BMK source, fiddling with env vars, etc, I can now build and run, so try this:

· Go to Control Panel\System and Security\System -> Advanced system settings -> Environment Variables and create a new environment variable called BMK_LD_OPTS, giving it this value:

-lmsvcrt -lgcc


Like so:



· Log off and back on. (In theory, restarting any program that accesses a new/modified env var should be enough, but I specifically had to do this.)

· Run the above test program and hopefully it'll now be working.

This seems to be the only way to do it that I can find -- just importing these libs in-program doesn't work, as apparently there is a dependency between the libs that only goes one way... or something...

BMK_LD_OPTS appears to be an undocumented way to add GCC linker options (see BlitzMax\src\bmk\bmk_util.bmx if interested.)

Disclaimer: don't totally know what I'm talking about... I was just winging it!

Last edited 2012


xlsior(Posted 2012) [#14]
Ah!

Come to think of it, I'm not using the stock bmk.exe on my computer, but am using Brucey's version, that could be why it was working OK on my machine?


Afke(Posted 2012) [#15]
Thank you ,


It finally works , thank you very much .

xlsior

thank you too

Last edited 2012