public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
@ 2017-03-02 22:17 sorryforaskingthis.bk.ru via cygwin
  2017-03-02 22:54 ` Yaakov Selkowitz
  0 siblings, 1 reply; 6+ messages in thread
From: sorryforaskingthis.bk.ru via cygwin @ 2017-03-02 22:17 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 772 bytes --]

I've done fresh install of cygwin with setup-x86.exe @ Win10 LTSB 2015 x64.

I've installed gcc-core and w32api-runtime packages.

opengl32.dll in System32 folder is 32-bit dll

With x86_64 install of cygwin ld able to find reference to wglCreateContext, with x86 - not.

$ gcc -o /tmp/conftest.exe /tmp/conftest.c -lopengl32
/tmp/ccec30zH.o:conftest.c:(.text+0xc): undefined reference to `wglCreateContext'

conftest.c:

#ifdef __cplusplus
extern "C"
#endif
char wglCreateContext ();
int
main ()
{
return wglCreateContext ();
  ;
  return 0;
}\0ТÒÐÐ¥\a&ö&ÆVÒ\a&W\x06÷'G3¢\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒ÷\a&ö&ÆV×2æ‡FÖÀФd\x15\x13¢\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöf\x17\x12ðФFö7VÖVçF\x17F–öã¢\x02\x02\x02\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R\x06–æfó¢\x02\x02\x02\x02\x02\x06‡GG\x03¢òö7–wv–âæ6öÒöÖÂò7Vç7V'67&–&R×6–×\x06ÆPРÐ

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
  2017-03-02 22:17 i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system sorryforaskingthis.bk.ru via cygwin
@ 2017-03-02 22:54 ` Yaakov Selkowitz
  0 siblings, 0 replies; 6+ messages in thread
From: Yaakov Selkowitz @ 2017-03-02 22:54 UTC (permalink / raw)
  To: cygwin

On 2017-03-02 16:17, sorryforaskingthis.bk.ru via cygwin wrote:
> $ gcc -o /tmp/conftest.exe /tmp/conftest.c -lopengl32
> /tmp/ccec30zH.o:conftest.c:(.text+0xc): undefined reference to `wglCreateContext'
>
> conftest.c:
>
> #ifdef __cplusplus
> extern "C"
> #endif
> char wglCreateContext ();
> int
> main ()
> {
> return wglCreateContext ();
>   ;
>   return 0;
> }

This looks like a snippet of an autoconf AC_CHECK_LIB (or 
AC_CHECK_FUNCTION) test.  Such tests don't work with 32-bit Win32 APIs 
-- on either Cygwin or MinGW -- because they don't take stdcall into 
account.  You'll need to modify the test to work around that.

Also, if you're using Cygwin, do you *really* want to be using Win32 
OpenGL and not X11?

-- 
Yaakov

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
  2017-03-03  0:14 sorryforaskingthis.bk.ru via cygwin
  2017-03-03  1:19 ` Yaakov Selkowitz
@ 2017-03-03 13:50 ` Andrey Repin
  1 sibling, 0 replies; 6+ messages in thread
From: Andrey Repin @ 2017-03-03 13:50 UTC (permalink / raw)
  To: sorryforaskingthis.bk.ru via cygwin, cygwin

Greetings, sorryforaskingthis.bk.ru via cygwin!

> Yes, I need to use Win32.
> also want to save performance as much as possible.

Choose one or another.
In my experience, 32-bit apps perform worse on 64-bit host than native apps.


-- 
With best regards,
Andrey Repin
Friday, March 3, 2017 16:45:20

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
  2017-03-03  1:19 ` Yaakov Selkowitz
@ 2017-03-03  1:57   ` Michael Enright
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Enright @ 2017-03-03  1:57 UTC (permalink / raw)
  To: cygwin

On Thu, Mar 2, 2017 at 5:19 PM, Yaakov Selkowitz wrote:
>
> Maybe, maybe not.  Mixing *NIX and Win32 APIs isn't so simple.
>

I have some small projects that do this mixing. A determined
individual can do it. I have not done it with 'wgl'

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
  2017-03-03  0:14 sorryforaskingthis.bk.ru via cygwin
@ 2017-03-03  1:19 ` Yaakov Selkowitz
  2017-03-03  1:57   ` Michael Enright
  2017-03-03 13:50 ` Andrey Repin
  1 sibling, 1 reply; 6+ messages in thread
From: Yaakov Selkowitz @ 2017-03-03  1:19 UTC (permalink / raw)
  To: cygwin

On 2017-03-02 18:14, sorryforaskingthis.bk.ru via cygwin wrote:
>> On 2017-03-02 16:54, Yaakov Selkowitz <yselkowitz@cygwin.com> wrote:
>>
>> This looks like a snippet of an autoconf AC_CHECK_LIB (or
>> AC_CHECK_FUNCTION) test. Such tests don't work with 32-bit Win32 APIs
>> -- on either Cygwin or MinGW -- because they don't take stdcall into
>> account. You'll need to modify the test to work around that.
>>
>> Also, if you're using Cygwin, do you *really* want to be using Win32
>> OpenGL and not X11?
>>
> Yes, you're right. It's autoconf test and it perfectly passed at 64-bit MinGW
> and 64-bit Cygwin, but not on 32-bit Cygwin.

It would fail on 32-bit MinGW too.

> And I don't understand why you're say that it is related to stdcall, while
> wglCreateContext exposed directly without any @0 @4 etc.

No, it's not, check the implib yourself.  You have to use a proper 
declaration to link stdcall functions, and the autoconf tests don't do 
that.  You need to change the test to avoid this; exactly how depends on 
the intent of the test.

> Yes, I need to use Win32.
          ^^^^
> I want to port application that heavily POSIX-dependent, but also want to save
                                                                     ^^^^
> performance as much as possible.

Big difference.

> I think if w32api-runtime package is provided it supposed to work.

Maybe, maybe not.  Mixing *NIX and Win32 APIs isn't so simple.

-- 
Yaakov

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system
@ 2017-03-03  0:14 sorryforaskingthis.bk.ru via cygwin
  2017-03-03  1:19 ` Yaakov Selkowitz
  2017-03-03 13:50 ` Andrey Repin
  0 siblings, 2 replies; 6+ messages in thread
From: sorryforaskingthis.bk.ru via cygwin @ 2017-03-03  0:14 UTC (permalink / raw)
  To: cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1199 bytes --]

>On 2017-03-02 16:54, Yaakov Selkowitz <yselkowitz@cygwin.com> wrote:
>
>This looks like a snippet of an autoconf AC_CHECK_LIB (or
>AC_CHECK_FUNCTION) test. Such tests don't work with 32-bit Win32 APIs
>-- on either Cygwin or MinGW -- because they don't take stdcall into
>account. You'll need to modify the test to work around that.
>
>Also, if you're using Cygwin, do you *really* want to be using Win32
>OpenGL and not X11?
>
Yes, you're right. It's autoconf test and it perfectly passed at 64-bit MinGW and 64-bit Cygwin, but not on 32-bit Cygwin.
And I don't understand why you're say that it is related to stdcall, while wglCreateContext exposed directly without any @0 @4 etc. With --enable-stdcall-fixup ld says: undefined reference to `wglCreateContext@0'

Yes, I need to use Win32.
I want to port application that heavily POSIX-dependent, but also want to save performance as much as possible.

I think if w32api-runtime package is provided it supposed to work.\x03B‹KCB”\x1c›Ø›\x19[H\x1c™\^[ܝ\x1cΈ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÜ\x1c›Ø›\x19[\Ëš\x1d^[[\x03B‘TNˆ\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ˜\KÃB‘^[ØÝ[Y[\x18]\x1a[ÛŽˆ\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ^[ØÜËš\x1d^[[\x03B•[œÝXœØÜšX™H\x1a[™›Îˆ\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÛ[\vÈÝ[œÝXœØÜšX™K\Ú[\^[\x19CBƒB

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-03 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02 22:17 i686 ld couldn't resolve wglCreateContext from libopengl32.a on x86_64 system sorryforaskingthis.bk.ru via cygwin
2017-03-02 22:54 ` Yaakov Selkowitz
2017-03-03  0:14 sorryforaskingthis.bk.ru via cygwin
2017-03-03  1:19 ` Yaakov Selkowitz
2017-03-03  1:57   ` Michael Enright
2017-03-03 13:50 ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).