Hello out there,
not being a regular user of GCC it has always been somewhat of a
mystery to me. However, I thought that I knew the trivial basics, like
how to compile a single file - but apparently not. Consider the screen
dump below:
---
d:\proj\_ToolsSE\C2Tcl\lex-yacc\tcl2c>c:\msys64\mingw64\bin\gcc
--version
gcc (Rev10, Built by MSYS2 project) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
d:\proj\_ToolsSE\C2Tcl\lex-yacc\tcl2c>c:\msys64\mingw64\bin\gcc -c >restrgram.c
d:\proj\_ToolsSE\C2Tcl\lex-yacc\tcl2c>c:\msys64\mingw64\bin\gcc -c >non-existing.c
d:\proj\_ToolsSE\C2Tcl\lex-yacc\tcl2c>
---
The first call seems to acknowledge that this is, in fact, GCC. The
second should have produced lots of error messages because of
#include(s) not found, etc. And the third should complain that >'non-existing.c' in fact didn't exist - but nothing.
I think I recall that I have been using GCC in the past without
problem - though possibly not this particular incantation.
Anyway, if somebody could shed some light on this (for me) mystery it
would be greatly appreciated.
Helmut
* Helmut GieseI think the program simply dies because some component cannot find the necessary DLLs. Running from a MinGW terminal ought to set up the path correctly. I cannot confim it, of course, because on my system gcc, even the one from MinGW, seems to be able to
| d:\proj\_ToolsSE\C2Tcl\lex-yacc\tcl2c>c:\msys64\mingw64\bin\gcc -c
| non-existing.c
Looks like you're running this inside a DOS command shell?
Might be an issue with the standard channels (stdin/stdout/stderr), or
some additional environment variables required.
Try running it from a Mingw terminal window and see whether this makes a difference.
HTH
R'
Hello,
@Ted: I did try '-v' and this resulted in an enormous amount of output
- but still no error message and no .o file generated.
@Ralf: Apparently running from an MSYS terminal does make a
difference.
@Arjen: Yes, this might explain it.
Meanwhile, after copying the source files into an'MSYS' directory I
now have three .o files there.However, I ave been unable to link with
Tcl's stub library. Consider the screen dump below:
hgiese@ratiosoft MINGW64 ~/Parser
$ dir
libtcl86.a parse.c restrgram.c restrgram.o std-lex.o
libtclstub86.a parse.o restrgram.h std-lex.c tclstub86.lib
hgiese@ratiosoft MINGW64 ~/Parser
$ gcc -shared parse.o restrgram.o std-lex.o -o./parse.dll -L . -l >tclstub86.lib >C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
cannot find -ltclstub86.lib: No such file or directory
collect2.exe: error: ld returned 1 exit status
In this directory I have
- 3 source files
- the corresponding .o files
- the stub lib I want to link with
- even the .a files following a suggestion found via Google
to no avail: It cannot find tclstub86.lib
Why?
If you have any suggestion this would be great.
In any case: thanks so far.
Helmut
The usual use of "-lwhatever" searches for "libwhatever.a", so I'm not >surprised -l tclstub86.lib confuses it. Maybe "-l libtclstub86" to useMany, many thanks - you made my day.
the libtclstub86.a file?
The usual use of "-lwhatever" searches for "libwhatever.a"That's what one could call 'convention', which is well known to the
That's what one could call 'convention', which is well known to the
'natives' but completely out of the world for an outsider (like me). I
read '-l' refers to a library file - and the library was for me
tclstub86.lib (note the extension?).
Well, I'd bettter be prepared for more surprises like this.
But for now I have to thank all of you because without your help I
would never have arrived at this solution, no way.
Many, many thanks
Helmut
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 34:55:47 |
| Calls: | 12,109 |
| Files: | 15,006 |
| Messages: | 6,518,344 |