"cannot find -lwinpthread" error at linking time

BlitzMax Forums/BlitzMax Beginners Area/"cannot find -lwinpthread" error at linking time

Ralighón(Posted 2017) [#1]
Hi,

I am exactly in the same situation that Yue in another post. At linking time I get...

[100%] Linking:MalangSwara v1.02 - x86.exe
C:/BlitzMax/MinGW32/bin/ld.exe: cannot find -lunicows
C:/BlitzMax/MinGW32/bin/ld.exe: cannot find -lwinpthread
Build Error: Failed to link F:/MalangSwara/MalangSwara v1.02 - develop/MalangSwara v1.02 - x86.exe
process complete

As you can see, the linker doesn't found something called "unicows" and "winpthread"... and is fully right: these files do not exist neither in my hard drive nor in the MinGW site, it seems (with oe without the leading "l" -- I assume that the linker has placed it somehow).

Things I have done before asking for your help? A lot:

- I have upgraded bmk.exe

- I have reinstalled MinGW (basic installation, version 5.3.0) inside c:\BlitzMax, in a folder named MinGW32.

- I have checked the environment variables (I have created a user one, and I have appended the path to MinGW32 and MinGW32\bin to PATH)

- I have recompiled all modules with bmk makemods -a -r (the modules are: brl.mod, maxGUI.mod, pub.mod, wx.mod) with no errors.

- I have tried compiling my program both threaded and non threaded mode.

And, of course, I have followed the indications you give to Yue. No avail :(

--

BTW, all this play began when I tried to install wx.mod. I just placed the pre-compiled version inside the mod folder but It didn't work. I could not recompile because I haven't MinGW installed. THIS is the closest point I have reached to get wx.mod working, what is my ultimate goal.

If I roll back the bmk.exe to the old version and recompile the modules, everything goes fine... except wx.mod. The compiler just "doesn't find the interface" -- neither wx.mod nor any other mod outside the BlitzMax installation (version 1.50). Not even the sample files work :O

I hope you have some advice for me.

Thank you!


Floyd(Posted 2017) [#2]
I can't really help, but -l means library, and -lunicows is looking for a library named unicows.

It is for WinMe and earlier to facilitate the use of Unicode. I remember that being an issue when trying to get the Max IDE working with older versions of Windows. That was probably ten years ago.


Ralighón(Posted 2017) [#3]
Hi Floyd,

I am using IndevIDE over W7, but MaxIDE throws the same errors. Looks like they are not system-related... but go know! I have reached the limit of my knowledge. Any idea will be welcomed.

Please, note that there is an underlying problem here: make wx.mod work (in my particular case, of course :).

Thanks for answer!


Ralighón(Posted 2017) [#4]
Hi Henri,

I've just tried it. I have recompiled all modules with bmk makemods -a -r (got an error in wxrarinputstream.mod so I have compressed it to keep it safe, deleted the folder and recompile).

I have tried to compile 'wxAboutBox sample'. No luck:

C:/BlitzMax/MinGW32/bin/ld.exe: cannot find -lwinpthread

It was a good guess, anyway. Thank you!


Ralighón(Posted 2017) [#5]
Hi again,

Just for the sake of trying, I have tried to compile 'wxAboutBox sample' with the old bmk (and the new and freshly compiled wx.mod). I have got a lot of:

C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw31u_adv.a(advlib_hyperlinkg.o):hyperlinkg.cpp:(.text+0xaae): undefined reference to `__gxx_personality_sj0'
C:/BlitzMax/mod/wx.mod/wx.mod/../lib/win32/libwxmsw31u_adv.a(advlib_hyperlinkg.o):hyperlinkg.cpp:(.text+0xad6): undefined reference to `_Unwind_SjLj_Register'


Maybe this is an additional clue...

Greetings,


Henri(Posted 2017) [#6]
That is a MinGW issue.

Here are some instructions for setting up MinGW:http://www.blitzmax.com/Community/post.php?topic=107311&post=1328178

-Henri


Ralighón(Posted 2017) [#7]
Hi again, Henri.

Yes, I had have tried this before, but nevertheless I have made a clean start. I have reinstalled BlitzMax and followed the instructions until Step 3, when I try to build the new bmk and I get the following error:

error: CPU you selected does not support x86-64 instruction set
Build Error: failed to compile D:/Users/···/···/bmk-master/bmk_cores_win32.c


The CPU is an Intel core I5 vPro, it should support this instruction set, so I guess the error message actually refers to a different thing.

BTW, bmk compiles with no error if I install TDM MinGW 32 bits only... but the final result after Step 8 is BlitzMax unable to compile anything.

Nobody said that this would going to be easy :)

Maybe it would be easier and faster if someone passes me (or points me to) a pre-compiled zipped BlitzMax with a working wx.mod, but if you want to diagnose this particular issue, count on me, please!

Thanks a lot!


Brucey(Posted 2017) [#8]
Hallo,

You could try the latest release of BlitzMax NG from here : https://github.com/bmx-ng/bmx-ng/releases
And the latest wx.mod zip download from here : https://github.com/maxmods/wx.mod

Extracting the zip into the mods folder and renaming it wx.mod, should be everything you need to use wxMax.

<EDIT> I just tried it on Windows 10, and built one of the samples, which worked okay.


Henri(Posted 2017) [#9]
Hi Brucey,

does the wxFlatNotebook-example work also ? I'll do some testing after work.


@Ralighon

Brucey's suggestion is valid if you like to try. The error that you are getting points to invalid Blitzmax installation (perhaps multiple setups ?) or invalid deployment of bmk. I'll check.

-Henri


Henri(Posted 2017) [#10]
Okei, I did try the NG setup, which seems to run great. I did get crash in flatnotebook.bmx example though when toying with notebook widgets titlebar. Almost like a rendering failure. I believe this is not NG related, but MinGW related as well, because with older MinGW it works.

@Ralighon

I tried compiling bmk.bmx (step 3) with NG from the link Brucey provided & Vanilla BMX downloaded from Blitzmax.com and got no errors. Perhaps you are using a different build version of bmk already ? Try the original. Also check where MaxIDE thinks the MinGW location is.

-Henri


Ralighón(Posted 2017) [#11]
Hi,

OK, you did it!

At all the tests, I allways uninstall the sw using the system tools and delete all the previous folders to have a clean install. I have done it with the latest release of BlitzMax NG and the latest wx.mod zip, and it works.

Moreover, I have successfully recompiled all the modules and the documentation. Also, I have recompiled my program successfully (with a lot of type mismatch errors, just as SuperStrict is meant to be).

Anyway, I have kept a compressed copy of my previous BlitzMax installation, just in case you want to do the troubleshooting. If it is the case, let me know and tell me what do you want me to try.

Thank you Floyd, Henri and Brucey!


TomToad(Posted 2017) [#12]
I had a similar, but not exact problem. BlitzMax wasn't finding files I knew were there. Turns out some program (still never figured out which) installed its own version of MinGW, and bmx kept using that version. This was kind of weird because bmx-ng uses MinGW in its own folder, and even that was giving me problems. I guess that gcc will pull some of the files it needs from the %path% environment anyway regardles of how it is initially called.

Solution was simple, remove the path of the unwanted MinGW from the %path% environment and everything worked fine. You might want to try opening a command prompt and type where gcc to see if it is being run from the correct version of MinGW.


Ralighón(Posted 2017) [#13]
Hi TomToad,

MinGW seems to be in the correct place, C:\BlitzMax\MinGW32\bin\gcc.exe. I have installed and reinstalled it several times, sometimes inside the C:\BlitzMax folder, sometimes in its own C:\MinGW32 folder.

The releases at https://github.com/bmx-ng/bmx-ng/releases and https://github.com/maxmods/wx.mod (see above) work, although I have not tested them yet on MacOS or Linux.

Thanks!