Jump to content

failing to build on windows


tubbutec

Recommended Posts

Hi,

I am trying to build ugfx on Win7 (64bit) and followed the guide in the wiki:

http://wiki.ugfx.org/index.php/Your_First_Compile_-_Windows

Could not find the exact packages mentioned in the wiki (I guess they are called differently now). The gcc version closest to the one mentioned in the makefile I could download using the installer was

i686-w64-mingw32-gcc

instead of
i686-pc-mingw32-gcc

changed the makefile accordingly. The code builds, but the linker shows the following error:

Linking .build/testProject.exe
/cygdrive/c/Users/280grad/AppData/Local/Temp/cckDx1MV.ltrans0.ltrans.o:cckDx1MV.ltrans0.o:(.text+0x2380): multiple definition of `main'
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:17: first defined here

/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o): In function `main':
/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:18: undefined reference to `WinMain@16'
collect2: error: ld returned 1 exit status
make: *** [../uGFX/tools/gmake_scripts/compiler_gcc.mk:284: .build/testProject.exe] Error 1

I tried both the 32bit and 64bit version of cygwin, but with the same result.

Any help would be very much apprechiated

Thanks a lot

Link to comment
Share on other sites

I have this same problem and I couldn't use provided toolchain because it is a win64 application and I am running win xp:

Linking .build/TestProject.exe
/cygdrive/c/DOCUME~1/bluexp/LOCALS~1/Temp/cc4tuJ82.ltrans0.ltrans.o:cc4tuJ82.lt
rans0.o:(.text+0x2380): multiple definition of `main'
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-
crt0_c.o):/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:17: first def
ined here
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-
crt0_c.o): In function `main':
/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:18: undefined reference
 to `WinMain@16'
collect2: error: ld returned 1 exit status
make: *** [../uGFX/tools/gmake_scripts/compiler_gcc.mk:284: .build/TestProject.e
xe] Error 1

 

Link to comment
Share on other sites

But the problem above does not related to win XP, I tried on another PC with Windwos 7 (32bit) and the result is the same:

Linking .build/TestProject.exe
/cygdrive/c/Users/bluexp/AppData/Local/Temp/ccJJHHFz.ltrans0.ltrans.o:ccJJHHFz.
ltrans0.o:(.text+0x2380): multiple definition of `main'
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-
crt0_c.o):/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:17: first def
ined here
/usr/i686-w64-mingw32/sys-root/mingw/lib/../lib/libmingw32.a(lib32_libmingw32_a-
crt0_c.o): In function `main':
/usr/src/debug/mingw64-i686-runtime-4.0.6-1/crt/crt0_c.c:18: undefined reference
 to `WinMain@16'
collect2: error: ld returned 1 exit status
make: *** [../uGFX/tools/gmake_scripts/compiler_gcc.mk:284: .build/TestProject.e
xe] Error 1

 

Link to comment
Share on other sites

Studio is cuurently 64bit only. The compilers/toolchains are available from multiple sources in both 32bit and 64bit versions.

The pc vs w32 change seems to be a cygwin difference between the eabi and the elf versions or in this case the toolchain for compiling windows programs versus those to compile command line programs hence it complaining about main(). We will look at updating the wiki when we have had a chance to test it with a new version of cygwin.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...