Make error during linking on cygwin Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
jubee
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 29, 2021 5:14 pm

Make error during linking on cygwin

Post by jubee »

Background:
I am not an administrator on my windows 10 computer;
I am using Cygwin64 Terminal with GNU_Make_4.3 to make wxWidgets_3.0.5 from source;
I ran the command ../configure --enable-debug --enable-monolithic --enable-unicode --disable-shared --prefix="$(pwd)" which seemed to do what it was supposed to;
I ran make and had to fix compiler errors (pointer casting) in volume.cpp, socket.cpp, and sockmsw.cpp

now I am stuck on a linker error and I have not been able to find anything online along the same lines:

ranlib /cygdrive/c/Users/BaermJu/Documents/TSSR/wxWidget_cygwin/build-debug/lib/libwx_mswu_gl-3.0.a
(if test -f utils/wxrc/Makefile ; then cd utils/wxrc && C:/Program Files (x86)/GNU_Make_4.3/lib/make/tools/install/bin/make.exe all ; fi)
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `(if test -f utils/wxrc/Makefile ; then cd utils/wxrc && C:/Program Files (x86)/GNU_Make_4.3/lib/make/tools/install/bin/make.exe all ; fi)'
make: *** [Makefile:16168: wxrc] Error 1

Any suggestions what I could try to resolve this error?
thanks.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Make error during linking on cygwin

Post by stahta01 »

Git rid of the configure option "--enable-monolithic"; it is not worth trying!
Note: You should delete the build folder after changing the "monolithic" setting to false.

You need to state what compiler you are trying to use!
You need to state if you are trying to build wxGTK or wxMSW build of wxWidgets.
You should post the information displayed at the end of the configure step to help us help you.

Edit: Use the cygwin make unless you wish to figure out this problem all by yourself!

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Make error during linking on cygwin

Post by stahta01 »

If you wish to use an non standard make under Cygwin at least put it in a path with no spaces or special characters like "(" or ")".

Edit: The other option is to edit the makefile to use double quotes around the path; this may or may not fix the problem.

Tim S.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Make error during linking on cygwin

Post by ONEEYEMAN »

Hi,
Also it would be interesting what errors you fixed and how.
Could you please provide this info.

And finally, on top what Tim said, you can drop --enable-unicode option - it is on by default.

Thank you.
jubee
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 29, 2021 5:14 pm

Re: Make error during linking on cygwin

Post by jubee »

Thank you for your suggestions.

These are the steps I took based on your recommendations:
1) delete build-debug
2) mkdir build-debug
3) ../configure --enable-debug --disable-shared --prefix="$(pwd)"

Using GNU g++ compiler

I am limited as to what gets installed and where on my system, and my installation of cygwin did not contain a built-in make hence the usage of GNU-Make.

As for the compiler errors I will copy the changed lines below:
1) line 353 in ../src/msw/sockmsw.cpp if ( select(socket->m_fd + 1, &fds, NULL, NULL, (PTIMEVAL)(&tv)) != 1 )
2) line 1344 in ../src/common/socket.cp const int rc = select(m_fd + 1, preadfds, pwritefds, &exceptfds, (PTIMEVAL)(&tv));
3) line 469 in ../src/msw/volume.cpp ::InterlockedExchange((volatile long unsigned int*)(&s_cancelSearch), TRUE);

The newly configured output:
Configured wxWidgets 3.0.5 for `x86_64-unknown-cygwin'

Which GUI toolkit should wxWidgets use? msw
Should wxWidgets be compiled into single library? no
Should wxWidgets be linked as a shared library? no
Should wxWidgets support Unicode? yes (using wchar_t)
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.6 no
wxWidgets 2.8 yes
Which libraries should wxWidgets use?
STL no
jpeg builtin
png builtin
regex builtin
tiff builtin
zlib builtin
expat builtin
libmspack no
sdl no

I will now run make again and report back on the result.

Jutta

Update:
The above did not change the result.
So I copied the GNU_Make_4.3 to a different directory (without spaces and ()). Then I did make clean followed by make and that seems to have done the trick.
I am currently running make on the samples directory.

I also tried to use the latest wxWidgets-3.1.4, but I did not get past the configure stage.
Last edited by jubee on Mon Feb 01, 2021 9:33 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Make error during linking on cygwin

Post by ONEEYEMAN »

Hi,
Can you run "git diff" or generate a patch with you changes?
Also what version of the compiler you are using?

Thank you.
jubee
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 29, 2021 5:14 pm

Re: Make error during linking on cygwin

Post by jubee »

$ g++ --version
g++ (GCC) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I am new to this, so I do not know how to generate a patch or how and where to run "git diff", but if you can give me instructions, I can follow them and do as you ask.

I will attach the modified files here, just in case.
Attachments
volume.cpp
(21.43 KiB) Downloaded 66 times
sockmsw.cpp
(14.18 KiB) Downloaded 63 times
socket.cpp
(56.73 KiB) Downloaded 68 times
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Make error during linking on cygwin

Post by ONEEYEMAN »

Hi,
I presume you got the sources with the "git clone". If not - let me know.

Do the following:

Code: Select all

cd c:/wxWidgets
git diff >> mypatch
Adjust directory as appropriate.
Attach the file "mypatch" here.

Thank you.
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Make error during linking on cygwin

Post by doublemax »

I'm skeptical about the changes you made. It's possible that you hid real 32 vs 64 bit mismatches there.

Can you try with the latest wxWidgets version from Github? (without modifications)
Use the source, Luke!
jubee
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 29, 2021 5:14 pm

Re: Make error during linking on cygwin

Post by jubee »

No I did not do the git clone thing.

I got the zip file from https://www.wxwidgets.org/downloads/ for the 3.0.5 stable version
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Make error during linking on cygwin

Post by stahta01 »

Are you saying you are not allowed to run "Cygwin Setup"?

Why are you using "Cygwin"?

Do you wish to build wxMSW or wxGTK version of wxWidgets? Please answer the question!!

Tim S.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Make error during linking on cygwin

Post by stahta01 »

Code: Select all

$ which g++
/usr/bin/g++

$ g++ --version
g++ (GCC) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
NOTE: Native cygwin GCC can not build wxMSW version of wxWidgets by design!!!

Edit: The design decisions made by Cygwin and wxWidgets teams resulted in the native Cygwin GCC being used to build only wxGTK (using X windows back end) or Cygwin MinGW64 GCC 32 or 64 bit building wxMSW version of wxWidgets that does not need the Cygwin DLLs to run.

So, if you are trying to build wxMSW using the Cygwin native GCC expect a lot of editing and trial and errors to maybe get something that works.

Tim S.
jubee
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jan 29, 2021 5:14 pm

Re: Make error during linking on cygwin

Post by jubee »

Hi,

To be honest, I don't really know what version I was going for, just one that would allow me to be used with code::blocks.
I am working on a project that ideally will run on both Windows and Linux without too many source code differences. So if I can create an environment on both systems with similar setups and just copy source code back and forth that would really help.

I am new to GUI development, but have used MSVS's Form Project for a while now and was hoping that code::blocks with wxWidgets would allow me to build a new GUI relatively easy, without writing everything from scratch.

I hope this answers the question?

Jutta
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: Make error during linking on cygwin

Post by stahta01 »

So, you really have no reason to use Cygwin; I suggest installing an normal MinGW64 GCC compiler toolchain and building using the normal method of makefile.gcc instead of configure.

Edit: The use of native Cygwin GCC does allow little code change in network socket applications; this would be a real reason to use native Cygwin GCC and wxGTK. But, the hassle of getting X Windows to work under CYgwin is not easy!

Tim S.
Last edited by stahta01 on Tue Feb 02, 2021 3:20 pm, edited 1 time in total.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7459
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Make error during linking on cygwin

Post by ONEEYEMAN »

Hi,
Why not download and install MinGW{64}?
Then you don't need a Cygwin environment and it will be easy to run C::B.

Thank you.
Post Reply