Re: [Tinycc-devel] [BUG] 0.9.28.pre - Cannot link due to : undefined symbol 'main'

2021-11-22 Thread grischka

david.k...@libertysurf.fr wrote:

'GLFrontier-win32\src\lib\SDLmain.lib' contains an entry point to 'main'

Yet is not recognized as a library.

'GLFrontier-win32\src\lib\libSDLmain.a' contains an entry point to 
'console_main'

Both contains an entry point to 'WinMain@16', but this is "handled" by SDL.

So, I'm running out of idea how to get this linked.


"SDLmain.lib" and "libSDLmain.a" sounds like pre-made libraries for
usage with MSVC rsp. MINGW-GCC.

Both these binary formats are not compatible with tcc. See also
"tcc-win32.txt -> Limitations".

You'll need to get SDLmain.c and try to compile it from source
using tcc (which may or may not cause additional compilcations ...)

-- gr



Your thought ?

Regards, David KOCH

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] [BUG] 0.9.28.pre - Cannot link due to : undefined symbol 'main'

2021-11-21 Thread david . koch
Hi,

using TCC here and there, maintaining a "personal" copy here :

https://github.com/Kochise/tinycc_win32

I was working on compiling GLFrontier with TCC, yet just got :

tcc: error: undefined symbol 'main'

I made some slight changes to the code (like adding Christian Jullien's dirent 
for TCC).

You can find the "fork" here :

https://github.com/Kochise/GLFrontier-win32

1- clone the two repos into the same folder
2- go to 'GLFrontier-win32\src'
3- run 'Makefile-tcc.bat'

You'll get something like :

- - - 8< - - - - - - - - - - - - - - - - - - - - - - - - -
Microsoft Windows [version 10.0.19042.1348]
(c) Microsoft Corporation. Tous droits réservés.

f:\_GIT\GLFrontier-win32\src>Makefile-tcc.bat
 Deleting binaries...

  ::done

 Project settings...

  ::done

 Some flags...

#define __TINYC__ 928
#define __i386__ 1
#define __i386 1
#define _WIN32 1
#define __TCC_PP__ 1
#define __SIZEOF_POINTER__ 4
#define __SIZEOF_LONG__ 4
#define __STDC__ 1
#define __STDC_VERSION__ 199901L
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __ILP32__ 1
#define __INT64_TYPE__ long long
#define __SIZEOF_INT__ 4
#define __INT_MAX__ 0x7fff
#define __LONG_MAX__ 0x7fffL
#define __SIZEOF_LONG_LONG__ 8
#define __LONG_LONG_MAX__ 0x7fffLL
#define __CHAR_BIT__ 8
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __ORDER_BIG_ENDIAN__ 4321
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __WCHAR_TYPE__ unsigned short
#define __WINT_TYPE__ unsigned short
#define __declspec(x) __attribute__((x))
#define __cdecl
#define __UINTPTR_TYPE__ unsigned __PTRDIFF_TYPE__
#define __INTPTR_TYPE__ __PTRDIFF_TYPE__
#define __INT32_TYPE__ int
#define __BASE_FILE__ "-"
  ::done

 Compiling as68k...

  ::done

 Converting 'fe2.s' in C...

Pass 1
24701 functions generated.
Pass 2
Done! 539337 bytes and 759 relocations.
  ::done
  ::C version remains to be challenged :)

 Compiling virtual machine...

tcc version 0.9.28.pre (i386 Windows)
-> audio.c
<- audio.o
tcc version 0.9.28.pre (i386 Windows)
-> dirent.c
<- dirent.o
tcc version 0.9.28.pre (i386 Windows)
-> hostcall.c
<- hostcall.o
tcc version 0.9.28.pre (i386 Windows)
-> input.c
<- input.o
tcc version 0.9.28.pre (i386 Windows)
-> keymap.c
<- keymap.o
tcc version 0.9.28.pre (i386 Windows)
-> main.c
<- main.o
tcc version 0.9.28.pre (i386 Windows)
-> screen.c
<- screen.o
tcc version 0.9.28.pre (i386 Windows)
-> shortcut.c
<- shortcut.o
  ::done

 Generating definition files...

tcc version 0.9.28.pre (i386 Windows)
-> C:\WINDOWS\SYSTEM32\glu32.dll
<- glu32.def (52 symbols)
tcc version 0.9.28.pre (i386 Windows)
-> f:\_GIT\GLFrontier-win32\src\libvorbisfile.dll
<- libvorbisfile.def (35 symbols)
tcc version 0.9.28.pre (i386 Windows)
-> C:\WINDOWS\SYSTEM32\opengl32.dll
<- opengl32.def (368 symbols)
tcc version 0.9.28.pre (i386 Windows)
-> f:\_GIT\GLFrontier-win32\src\SDL.dll
<- SDL.def (180 symbols)
  ::done

 Generating 'GLFrontier'...

tcc version 0.9.28.pre (i386 Windows)
-> glu32.def
-> libvorbisfile.def
-> opengl32.def
-> SDL.def
-> .\src\audio.o
-> .\src\dirent.o
-> .\src\hostcall.o
-> .\src\input.o
-> .\src\keymap.o
-> .\src\main.o
-> .\src\screen.o
-> .\src\shortcut.o
-> fe2.o
tcc: error: undefined symbol 'main'
  ::Nooo...


f:\_GIT\GLFrontier-win32\src>
- - - 8< - - - - - - - - - - - - - - - - - - - - - - - - -

'GLFrontier-win32\src\lib\SDLmain.lib' contains an entry point to 'main'

Yet is not recognized as a library.

'GLFrontier-win32\src\lib\libSDLmain.a' contains an entry point to 
'console_main'

Both contains an entry point to 'WinMain@16', but this is "handled" by SDL.

So, I'm running out of idea how to get this linked.

Your thought ?

Regards, David KOCH

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel