Compiling Winelib application under x86_64

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
goldfinkle
Newbie
Newbie
Posts: 3
Joined: Sat Feb 21, 2009 3:03 am

Compiling Winelib application under x86_64

Post by goldfinkle »

Hi All

I'm trying to compile the following program

int main()
{
return 0;
}

I generated a makefile using winemaker

running make I get

wineg++ -c -mno-cygwin -o test.o test.cpp
wineg++ -mwindows -mno-cygwin -o test.exe.so test.o -lodbc32 -lole32 -loleaut32 -lwinspool -luuid
ld: Relocatable linking with relocations from format elf32-i386 (/usr/lib/wine/libwinecrt0.a(exe_entry.o)) to format elf64-x86-64 (test.UzYhKg.o) is not supported
winebuild: ld -r failed with status 256
winegcc: winebuild failed
make: *** [test.exe.so] Error 2

uname -a returns:
Linux host1 2.6.18-92.el5 #1 SMP Tue Feb 20 18:51:06 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

The distribution is centos 5

Any suggestions?

Thanks

Jeff
Last edited by goldfinkle on Sun Feb 22, 2009 12:50 pm, edited 1 time in total.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

You need to pass the '-m32' switch to winegcc/wineg++ to build 32-bit apps then it will work.
goldfinkle
Newbie
Newbie
Posts: 3
Joined: Sat Feb 21, 2009 3:03 am

Post by goldfinkle »

I get more or less the same output. Am I missing any other flag?


wineg++ -c -m32 -mno-cygwin -o test.o test.cpp
wineg++ -mwindows -mno-cygwin -o test.exe.so test.o -lodbc32 -lole32 -loleaut32 -lwinspool -luuid
ld: Relocatable linking with relocations from format elf32-i386 (test.o) to format elf64-x86-64 (test.k1twmC.o) is not supported
winebuild: ld -r failed with status 256
winegcc: winebuild failed
make: *** [test.exe.so] Error 2
goldfinkle
Newbie
Newbie
Posts: 3
Joined: Sat Feb 21, 2009 3:03 am

Post by goldfinkle »

Does anyone else have any other suggestions? I've seen this question asked quite a number of times but it has never been answered.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

goldfinkle wrote:Does anyone else have any other suggestions? I've seen this question asked quite a number of times but it has never been answered.
Look at Wine's makefiles. For example notepad, winecfg - any winelib app.

There is nothing related to cygwin so I don't know why you need to use it's flags.
Locked