-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
./configure fails with Unicode build #7229
Comments
EDIT: Better solution exists. Please see here! Possible workaround, if we don't want to patch the
To build curl: Note: In my test, this did not collide with curl's own |
Can you use -DUNICODE -D_UNICODE instead |
Sorry, but nope. Or I am missing something? 😕
This was tested with latest MinGW/GCC: Best regards. |
Yes, I think so. But it seems that However, what does work for me is:
So that probably is the way to go. Still, figuring this out was wearisome. Maybe add a Thank you and best regards. (BTW: What is the difference between |
Seems like a good idea.
I think it was added to pass cflags without overriding the default CFLAGS. It's not documented and I may be wrong... |
|
This issue seems to have stalled. Is there anything we can/should do about this report? Any proposed next steps? |
I think it'd be best to complete Unicode support in libcurl and then fix the different build systems to enable it correctly. Though these two can be done in any order or in parallel. @jay had a nice patch for the former, though I continue to think that fall-back methods are bad and should not be used in libcurl. (Yes, OpenSSL uses one such method, but OpenSSL also keeps at least one Windows vulnerability open since years without intention to fix it (along some other past woes on Windows), so I think it should not be regarded as the yardstick for Windows-development specifically.) |
👍 ⚡ |
Anyone care to write this issue up in a brief summary for adding to the |
IMO this isn't a bug, it's either an enhancement or a feature request. The user wants an easier way to tell autotools to build curl with Windows Unicode support, like |
I tried to fix this without the CPPFLAGS="${CPPFLAGS} -Dmain=wmain"
CPPFLAGS="${CPPFLAGS} -DUNICODE -D_UNICODE"
LDFLAGS="${LDFLAGS} -municode" It'd be better to restrict If this is a feasible solution, adding an This new warning came up, unrelated to either of the above hacks:
|
llvm/clang and gcc doesn't recognize the wmain() function in Unicode Windows builds: ``` ../../src/tool_main.c:239:5: warning: no previous prototype for function 'wmain' [-Wmissing-prototypes] int wmain(int argc, wchar_t *argv[]) ^ 1 warning generated. ``` Before this patch, we already silenced it with CMake. This patch moves the silencing to the source, so that it applies to all build tools. Bug: curl#7229 (comment) Closes #xxxxx
llvm/clang and gcc doesn't recognize the wmain() function in Unicode Windows builds: llvm/clang: ``` ../../src/tool_main.c:239:5: warning: no previous prototype for function 'wmain' [-Wmissing-prototypes] int wmain(int argc, wchar_t *argv[]) ^ 1 warning generated. ``` gcc: ``` ../../src/tool_main.c:239:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes] 239 | int wmain(int argc, wchar_t *argv[]) | ^~~~~ ``` Before this patch, we already silenced it with CMake. This patch moves the silencing to the source, so that it applies to all build tools. Bug: #7229 (comment) Reviewed-by: Marcel Raad Closes #10744
With a local hack: curl/curl#7229 (comment) Ref: curl/curl#7229
llvm/clang and gcc doesn't recognize the wmain() function in Unicode Windows builds: llvm/clang: ``` ../../src/tool_main.c:239:5: warning: no previous prototype for function 'wmain' [-Wmissing-prototypes] int wmain(int argc, wchar_t *argv[]) ^ 1 warning generated. ``` gcc: ``` ../../src/tool_main.c:239:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes] 239 | int wmain(int argc, wchar_t *argv[]) | ^~~~~ ``` Before this patch, we already silenced it with CMake. This patch moves the silencing to the source, so that it applies to all build tools. Bug: curl#7229 (comment) Reviewed-by: Marcel Raad Closes curl#10744
Fixes curl#7229 Closes #xxxxx
Just tried the new Still same old problem: Configure script doesn't find "main" function, because, in Windows, when Unicode is enabled, the main function must be
Hence, the following hack still is required:
|
curl has a CI job that builds and tests fine without this hack: I've found that The hack also doesn't address building curl tests, which all use |
Yeah, that's right. But If To actually get the untainted command-line into the "main" function, as Unicode (UTF-16), we have to use a Therefore, I think that (I posted the result when I have a workaround that works for me. But I think a proper solution could be great for other users that face the same issue. |
As mentioned in the previous post, Lines 54 to 56 in 8ca6030
Lines 218 to 228 in 8ca6030
[ Generally speaking:
You seem to be passing Have you tried such build? |
Ah, I see now. You mean we can leave out |
Indeed, seems to work 🥳 |
I did this
I am trying to build curl with Unicode support on Windows (using MinGW/MSYS2).
In order to enable Unicode, I added options
-munciode
and-mconsole
to the CFLAGS explicitely, because apparently./configure
doesn't have a dedicated--enable-unicode
switch. Or did I miss something?Unforntunately, this caused
./configure
to fail with "No working C compiler" error. My analysis of theconfig.log
showed that./configure
uses a lot of "test" programs that havemain()
hardcoded, but should be usingwmain()
when Unicode is used! In the actual curl source codes we already do have the required#ifdef
s to use eithermain()
orwmain()
as needed. Only the./configure
has problem! My workaround was to replace all occurences of "main" in./configure
with "wmain", using a simplesed
command. This does work. After patchingconfigure
, the Unicode version of curl compiled without any problem!But this workaround is rather cumbersome and other people may run into the same issue. So I think it would be much preferable to have an
--enable-unicode
switch that not only addes-munciode
and-mconsole
to the CFLAGS automatically but also uses the "correct" main function in the "test" programs. At least make./configure
work with-munciode -mconsole
options.I expected the following
CFLAGS="-municode -mconsole" ./configure && make
should "just work" without the need to patchconfigure
.Even better,
./configure --enable-unicode && make
should be available.curl/libcurl version
7.77.0
operating system
Windows 10, using latest MinGW/MSYS2 compiler + build environment
The text was updated successfully, but these errors were encountered: