[winegcc] Cross-compiling glut program

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

[winegcc] Cross-compiling glut program

Post by Lachu » Wed Jul 25, 2012 11:49 am

Where I can put files with lib, h(C header) and def extension files?

I need to compile file with exe format (for Windows).

User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Re: [winegcc] Cross-compiling glut program

Post by DanKegel » Wed Jul 25, 2012 9:53 pm

Try 'winetricks glut'. Then add c:/glut-3.7.6-bin to your LIB and INCLUDE environment variables before compiling.

Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

Re: [winegcc] Cross-compiling glut program

Post by Lachu » Thu Jul 26, 2012 10:05 am

After invoking

Code: Select all

winetricks glut
and

Code: Select all

winegcc -lGL -lglut *.c
the last lines are

Code: Select all

normal.c: In function ‘CalculateNormal’:
normal.c:38:20: warning: incompatible implicit declaration of built-in function ‘sqrt’
artifact-xcEdMM.o: In function `glutInit_ATEXIT_HACK':
artifact.c:(.text+0x26): undefined reference to `__glutInitWithExit'
artifact-xcEdMM.o: In function `glutCreateWindow_ATEXIT_HACK':
artifact.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
artifact-xcEdMM.o: In function `glutCreateMenu_ATEXIT_HACK':
artifact.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
creature-zHPwGY.o: In function `glutInit_ATEXIT_HACK':
creature.c:(.text+0x26): undefined reference to `__glutInitWithExit'
creature-zHPwGY.o: In function `glutCreateWindow_ATEXIT_HACK':
creature.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
creature-zHPwGY.o: In function `glutCreateMenu_ATEXIT_HACK':
creature.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
hero-Zgq6tP.o: In function `glutInit_ATEXIT_HACK':
hero.c:(.text+0x26): undefined reference to `__glutInitWithExit'
hero-Zgq6tP.o: In function `glutCreateWindow_ATEXIT_HACK':
hero.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
hero-Zgq6tP.o: In function `glutCreateMenu_ATEXIT_HACK':
hero.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
keyboard-WoiUUD.o: In function `glutInit_ATEXIT_HACK':
keyboard.c:(.text+0x26): undefined reference to `__glutInitWithExit'
keyboard-WoiUUD.o: In function `glutCreateWindow_ATEXIT_HACK':
keyboard.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
keyboard-WoiUUD.o: In function `glutCreateMenu_ATEXIT_HACK':
keyboard.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
main-EMUNNP.o: In function `glutInit_ATEXIT_HACK':
main.c:(.text+0x26): undefined reference to `__glutInitWithExit'
main-EMUNNP.o: In function `glutCreateWindow_ATEXIT_HACK':
main.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
main-EMUNNP.o: In function `glutCreateMenu_ATEXIT_HACK':
main.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
main-EMUNNP.o: In function `display':
main.c:(.text+0x2ea): undefined reference to `gluLookAt'
main-EMUNNP.o: In function `main':
main.c:(.text+0x5c1): undefined reference to `gluPerspective'
md2-2-3oZt7R.o: In function `glutInit_ATEXIT_HACK':
md2-2.c:(.text+0x26): undefined reference to `__glutInitWithExit'
md2-2-3oZt7R.o: In function `glutCreateWindow_ATEXIT_HACK':
md2-2.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
md2-2-3oZt7R.o: In function `glutCreateMenu_ATEXIT_HACK':
md2-2.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
collect2: ld returned 1 exit status
winegcc: gcc failed

Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

Re: [winegcc] Cross-compiling glut program

Post by Lachu » Thu Jul 26, 2012 10:09 am

How add C:\glut-3.7.6-bin to lib and include directory(command)?

Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

Re: [winegcc] Cross-compiling glut program

Post by Lachu » Thu Jul 26, 2012 11:40 am

Code: Select all

> LIB=C:\\glut-3.7.6-bin INCLUDE=C:\\glut-3.7.6-bin winegcc -lGL -lglut
/usr/lib64/wine/libwinecrt0.a(exe_main.o): In function `main':
/usr/src/packages/BUILD/wine-1.4-rc4/dlls/winecrt0/exe_main.c:48: undefined reference to `WinMain'
collect2: ld returned 1 exit status
winegcc: gcc failed
How enable standard C entry point instead of Win32 entry point?

Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

Re: [winegcc] Cross-compiling glut program

Post by Lachu » Thu Jul 26, 2012 12:59 pm

Sorry for previous posts.

I use thiis command:

Code: Select all

> LIB=C:\\glut-3.7.6-bin INCLUDE=C:\\glut-3.7.6-bin winegcc -lGL -lglut *.c
And output is(few last lines):

Code: Select all

normal.c: In function ‘CalculateNormal’:
normal.c:38:20: warning: incompatible implicit declaration of built-in function ‘sqrt’
artifact-CzsPQm.o: In function `glutInit_ATEXIT_HACK':
artifact.c:(.text+0x26): undefined reference to `__glutInitWithExit'
artifact-CzsPQm.o: In function `glutCreateWindow_ATEXIT_HACK':
artifact.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
artifact-CzsPQm.o: In function `glutCreateMenu_ATEXIT_HACK':
artifact.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
creature-4jKVej.o: In function `glutInit_ATEXIT_HACK':
creature.c:(.text+0x26): undefined reference to `__glutInitWithExit'
creature-4jKVej.o: In function `glutCreateWindow_ATEXIT_HACK':
creature.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
creature-4jKVej.o: In function `glutCreateMenu_ATEXIT_HACK':
creature.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
hero-Wmiux5.o: In function `glutInit_ATEXIT_HACK':
hero.c:(.text+0x26): undefined reference to `__glutInitWithExit'
hero-Wmiux5.o: In function `glutCreateWindow_ATEXIT_HACK':
hero.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
hero-Wmiux5.o: In function `glutCreateMenu_ATEXIT_HACK':
hero.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
keyboard-LN1r98.o: In function `glutInit_ATEXIT_HACK':
keyboard.c:(.text+0x26): undefined reference to `__glutInitWithExit'
keyboard-LN1r98.o: In function `glutCreateWindow_ATEXIT_HACK':
keyboard.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
keyboard-LN1r98.o: In function `glutCreateMenu_ATEXIT_HACK':
keyboard.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
main-22lNQn.o: In function `glutInit_ATEXIT_HACK':
main.c:(.text+0x26): undefined reference to `__glutInitWithExit'
main-22lNQn.o: In function `glutCreateWindow_ATEXIT_HACK':
main.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
main-22lNQn.o: In function `glutCreateMenu_ATEXIT_HACK':
main.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
main-22lNQn.o: In function `display':
main.c:(.text+0x2ea): undefined reference to `gluLookAt'
main-22lNQn.o: In function `main':
main.c:(.text+0x5c1): undefined reference to `gluPerspective'
md2-2-8SamJz.o: In function `glutInit_ATEXIT_HACK':
md2-2.c:(.text+0x26): undefined reference to `__glutInitWithExit'
md2-2-8SamJz.o: In function `glutCreateWindow_ATEXIT_HACK':
md2-2.c:(.text+0x47): undefined reference to `__glutCreateWindowWithExit'
md2-2-8SamJz.o: In function `glutCreateMenu_ATEXIT_HACK':
md2-2.c:(.text+0x68): undefined reference to `__glutCreateMenuWithExit'
collect2: ld returned 1 exit status
winegcc: gcc failed
[/code]

User avatar
DanKegel
Moderator
Moderator
Posts: 1164
Joined: Wed May 14, 2008 11:44 am

Re: [winegcc] Cross-compiling glut program

Post by DanKegel » Thu Jul 26, 2012 2:15 pm

For winegcc and mingw, you probably have to use -I and -L arguments instead of INCLUDE and LIB
environment variables.

I'm not sure winegcc can handle native libraries, you might want to try mingw
(e.g. apt-get install mingw32).

Lachu
Level 1
Level 1
Posts: 6
Joined: Wed Jul 25, 2012 11:40 am

Re: [winegcc] Cross-compiling glut program

Post by Lachu » Sun Jul 29, 2012 2:53 pm

Ok. I have done my work - topic should been closed.

Locked