bmx-ng / bcc

A next-generation bcc parser for BlitzMax
zlib License
33 stars 12 forks source link

failed to link (libwinpthread -> lib png loader) #223

Closed eagle54 closed 8 years ago

eagle54 commented 8 years ago

hi, If i want to build this example :

SuperStrict

Framework maxgui.drivers Import brl.eventqueue Import brl.jpgloader

Global window:Tgadget Global p1:Tgadget Global pix1:TPixmap

window=CreateWindow(AppTitle,0,0,400,400,Null,WINDOW_TITLEBAR|WINDOW_CENTER) pix1=LoadPixmapJPeg("green.jpg")' a simple green color in jpg format (2X2 px) p1=CreatePanel(100,100,200,200,window) SetGadgetPixmap p1,pix1,PANELPIXMAP_TILE

While True WaitEvent Select EventID() Case EVENT_WINDOWCLOSE End End Select Wend End I have this error :

Building test1 [ 99%] Processing:test1.bmx [ 99%] Compiling:test1.bmx.gui.release.win32.x86.c [100%] Linking:test1.exe C:/BlitzMax/MinGW32/x86_64-w64-mingw32/lib32/libwinpthread.a(libwinpthread_la-misc.o):misc.c:(.text+0x50): undefined reference to __udivdi3' C:/BlitzMax/MinGW32/x86_64-w64-mingw32/lib32/libwinpthread.a(libwinpthread_la-misc.o):misc.c:(.text+0x11b): undefined reference to__udivdi3' Build Error: Failed to link C:/BlitzMax/Kit Blitzmax-ng/samples/GUI/test1.exe Process complete

If i want to build this example i must add : Import brl.pngloader and it works!

I only use jpeg loader (no png loader), because the size of my executable increases with png loader included

Config : Win7 x64 gcc 5.1.0 bcc 0.80 bmk 3.14 last packages from github

GWRon commented 8 years ago

Did you try a 64bit MinGW?

This might help as the issue is something which is ought to be related to 32/64 bit.

If that is true...then the internet provides a macro to replace that udivdi3-call. It then calls do_div() defined im asm/div64.h

GWRon commented 8 years ago

Maybe you could also try to add

Import "-lgcc"

To your main file... the libgcc should/could contain that function ...

eagle54 commented 8 years ago

hi GWRon,

64Bit MinGW is gcc 5.1.0 from bmx-ng 0.77 -> http://www.bmx-ng.com/main/files/BlitzMaxNG_win32_Unoffical_0_77.7z

c:\>gcc --version gcc (tdm64-1) 5.1.0

I tested my example with architecture x86, and i have this error I tested my example with option Import "-lgcc", and i have the same error (architecture x86). I tested my example with architecture x64, and it works (without option Import "-lgcc")

About do_div() macro, how to use it?

Link ; http://stackoverflow.com/questions/1063585/udivdi3-undefined-how-to-find-the-code-that-uses-it

Thanks in advance

GWRon commented 8 years ago

This would need to replace the calls done in the modules-used-libraries.

I assume "pub.libpng" includes a file somewhere which gets rid of the problem you encountered.

But you'd better wait for Brucey to come with something "official".

Edit: http://www.blitzmax.com/Community/posts.php?topic=101752 (or if logged in via blitzbasic.com) http://www.blitzbasic.com/Community/posts.php?topic=101752

Maybe you have multiple MinGW installed? I put mine in "BlitzMaxNG/MinGW32" (as this is where BMK NG looks too).

eagle54 commented 8 years ago

Edit : I use BlitzMaxNG_win32_Unoffical_0_77.7z and directories are not modified. I have one MinGW Directory

But you'd better wait for Brucey to come with something "official"

Yes, i think also

Thanks GWRon

woollybah commented 8 years ago

Should be working now with the latest code.