1. Compiling issue
- Posted by andi49 Feb 03, 2012
- 2048 views
Hallo
Also it was my own failure. I figured it out the hard way, that it is not possible to compile a program if it is including a file with the same name but a different extension.
Say i have a program called "myprog.exw" that includes "myprog.ew" this works fine with euiw.exe and eubind.exe. Also euc.exe seems to have no problem.
But during linking, Watcom C gives a lot of warnings and is unable to link the program, MinGW links it without warnings and errors but produces a unusable "myprog.exe".
So, becouse i wasted a lot of time with this, my question is, is it possible to mention this in the Docs or tweak euc.exe to give "clear" warning about this issue?
Thank you Andreas
2. Re: Compiling issue
- Posted by jimcbrown (admin) Feb 03, 2012
- 2037 views
Hallo
Also it was my own failure. I figured it out the hard way, that it is not possible to compile a program if it is including a file with the same name but a different extension.
This should work. This works for me.
Say i have a program called "myprog.exw" that includes "myprog.ew" this works fine with euiw.exe and eubind.exe. Also euc.exe seems to have no problem.
But during linking, Watcom C gives a lot of warnings and is unable to link the program, MinGW links it without warnings and errors but produces a unusable "myprog.exe".
I tried it on Linux/GNU with gcc and this works fine here.
So, becouse i wasted a lot of time with this, my question is, is it possible to mention this in the Docs or tweak euc.exe to give "clear" warning about this issue?
Thank you Andreas
This should not happen. If this doesn't work then something else is very wrong.
What sort of warnings do you get from Watcom C? What error messages do you get when you run myprog.exe from MinGW?
3. Re: Compiling issue
- Posted by andi49 Feb 03, 2012
- 2055 views
Hi
MinGW gives no warnings or errors the binary just returns to the prompt. The program did not start. Changing the the names say from "myprog.ew" to "myprog1.ew" and than includes this, fixes all problems.
I tried it with Eu4.0.3 stock from the OpenEuphoria website and a 4.1 from middle of January.
And, sorry i forget to mention. I'am on Windows XP Sp3.
With Watcom (the files are circmot.ew and circmot.exw)
euc circmot.exw > debug.txt
gives this debug.txt
Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27InitMotion_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27RunButtonClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27DrawMotion_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27Motion_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27Initialize_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27AngularVelocityEditClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27StopButtonClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndHotKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndTime_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndClose_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndRestore_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27EndButtonKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27StopButtonKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27RunButtonKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27AngularVelocityEditKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndKey_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27EndButtonMove_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27StopButtonMove_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27RunButtonMove_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27AngularVelocityEditMove_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndMove_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27EndButtonRRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27StopButtonRRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27RunButtonRRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27AngularVelocityEditRRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndRRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndRelease_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27EndButtonRClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27StopButtonRClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27RunButtonRClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27AngularVelocityEditRClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27WinHwndRClick_ ignored Warning! W1027: file CircMot.obj(C:\fred_mangan\compiletest\build-966949\CircMot.c): redefinition of _27EndButtonClick_ ignored Warning! W1008: cannot open graph.lib : No such file or directory Error! E2028: _1EventLoop_ is an undefined reference Error! E2028: _1WinMain_ is an undefined reference file init-.obj(C:\fred_mangan\compiletest\build-966949\init-.c): undefined symbol _1EventLoop_ file init-.obj(C:\fred_mangan\compiletest\build-966949\init-.c): undefined symbol _1WinMain_ file main-.obj(C:\fred_mangan\compiletest\build-966949\main-.c): undefined symbol _1WinMain_ Build directory: build-966949\ Translating code, pass: 1 2 3 4 5 6 7 8 9 10 11 generating Compiling with Watcom Compiling 1% init-.c Compiling 7% CircMot.c Compiling 10% main-.c Compiling 14% TinEWG.c Compiling 17% os.c Compiling 21% dll.c Compiling 25% machine.c Compiling 28% memconst.c Compiling 32% memory.c Compiling 35% types.c Compiling 39% pretty.c Compiling 42% filesys.c Compiling 46% datetime.c Compiling 50% get.c Compiling 53% text.c
4. Re: Compiling issue
- Posted by jimcbrown (admin) Feb 03, 2012
- 2034 views
Hi
MinGW gives no warnings or errors the binary just returns to the prompt. The program did not start.
Can you provide the binary?
Changing the the names say from "myprog.ew" to "myprog1.ew" and than includes this, fixes all problems.
I tried it with Eu4.0.3 stock from the OpenEuphoria website and a 4.1 from middle of January.
And, sorry i forget to mention. I'am on Windows XP Sp3.
With Watcom (the files are circmot.ew and circmot.exw)
euc circmot.exw > debug.txt
gives this debug.txt
Here are two test files, can you try them out and see if you have still have the same problem with these? If it works it should print out "-2" in a command prompt window and then exit immediately.
circmot.ew
global procedure InitMotion() ? -2 end procedure
circmot.exw
include circmot.ew global procedure WinMain() EventLoop() end procedure global procedure EventLoop() InitMotion() end procedure WinMain()
5. Re: Compiling issue
- Posted by andi49 Feb 03, 2012
- 2022 views
Hi
your provided sourcecode compiles with both watcom and gcc. So you are right there must be an other issue. But i can't figure it out now. Also the sourcecode of the program is not mine. I can't provide it to you.
If it is okay for you, i gonna ask him if it is okay that i send you the code (it's not big just a small program).
Thank you very much Andreas
6. Re: Compiling issue
- Posted by andi49 Feb 05, 2012
- 1815 views
Hallo, Weekend is over :)
I'am again searching for this issue. And have not found the failure in my system.
But for now i Have another question. After checking what euc.exe is doing (using Process Monitor). What is this "teksto.edb"? euc.exe seems to scan the whole system for this file.
examples fresh from my system ...
C:\Users\Shawn\Documents\development\include\win32lib\Include\teksto.edb
C:\Users\Shawn\Documents\development\hg\4.0\build\4.0.3rc2\transobj\teksto.edb
C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\teksto.edb
C:\Program Files\GnuWin32\bin\teksto.edb
etc.
Andreas
7. Re: Compiling issue
- Posted by DerekParnell (admin) Feb 05, 2012
- 1794 views
What is this "teksto.edb"? euc.exe seems to scan the whole system for this file.
This file is an optional text translation database. Euphoria looks for this to look up message numbers for their corresponding text. If the file is not found, Euphoria uses hard-coded text.
It does not look through the entire system for this file, just in a few specific places, depending on your entries in the eu.cfg file, plus some standard locations appropriate for your operating system.
As a bit of trivia, the name comes from the Esperanto word for 'text'.
8. Re: Compiling issue
- Posted by ne1uno Feb 06, 2012
- 1781 views
Hallo, Weekend is over :)
I'am again searching for this issue. And have not found the failure in my system.
[..]
C:\Users\Shawn\Documents\development\include\win32lib\Include\teksto.edb
C:\Users\Shawn\Documents\development\hg\4.0\build\4.0.3rc2\transobj\teksto.edb
C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\teksto.edb
not sure if this is related, use the euc -keep -makefile options and take a look. I have had problems with '-' in file names with watcom makefiles.
if you get an executable, to see how far it runs I have often turn on trace. with trace trace(3)
10. Re: Compiling issue
- Posted by BRyan Feb 06, 2012
- 1711 views
Hallo, Weekend is over :)
I'am again searching for this issue. And have not found the failure in my system.
[..]
C:\Users\Shawn\Documents\development\include\win32lib\Include\teksto.edb
C:\Users\Shawn\Documents\development\hg\4.0\build\4.0.3rc2\transobj\teksto.edb
C:\Program Files\ATI Technologies\ATI.ACE\Core-Static\teksto.edb
This is caused by Shawn's installer program being ship with
eu.cfg files set for his enviorment.
Just remove the the eu.cfg files from the source directory
search for any other directory that has them with and do the same.
11. Re: Compiling issue
- Posted by andi49 Feb 06, 2012
- 1708 views
circmot.ew
global procedure InitMotion() ? -2 end procedure
circmot.exw
include circmot.ew global procedure WinMain() EventLoop() end procedure global procedure EventLoop() InitMotion() end procedure WinMain()
Hallo again
It seems i wasn't accurate enough with the Filenames. The original filename where "CircMot.ew" and "CircMot.exw".
I didn't take care about upper/lower case becouse Windows normally ingnores them in filenames. But it seems that in some places there are differences.
If i change at least one letter in "circmot.exw" to uppercase like "Circmot.exw" or "cirCmot.exw" then the compiling fails. Any changes to "circmot.ew" have no effect.
I hope someone can proof this behavior, with the little examples that jimcbrown provided. (or maybe I'am going totally mad, that could be also a reason for what I'am seeing ont the screen ;)
Thank you Andreas
12. Re: Compiling issue
- Posted by jimcbrown (admin) Feb 06, 2012
- 1716 views
I looked at unique_c_name() in c_decl.e and that looked correct, so the current 4.0 branch should not experience this problem.
This problem could be happening in the 4.0.3 build if TUNIX was somehow set to true. In that case, unique_c_name() would not compensate for the case-insensitivity and think CircMot.c (for CircMot.exw) and Circmot.c (for Circmot.ew) are the same.
TUNIX should not be set to true, but I can see how this might have happened: someone crosstranslated the Windows code for the release. If crosstranslation is 100% perfect, then there shouldn't be any problems, but 4.0.3 was released a while ago and it's possible some old crosstranslation bug corrupted the build (e.g. incorrectly leaving TUNIX set even though the target system was Windows).
Try 4.0.2, 4.0.1, and 4.0.0 (in that order) to see if they have the same bug. If they don't, we can be pretty sure that these defects are a result of a badly built binary and we simply will need to re-release 4.0.3
13. Re: Compiling issue
- Posted by andi49 Feb 06, 2012
- 1673 views
Try 4.0.2, 4.0.1, and 4.0.0 (in that order) to see if they have the same bug. If they don't, we can be pretty sure that these defects are a result of a badly built binary and we simply will need to re-release 4.0.3
Hallo
I do not have all the binaries for the different Versions here. I have downloaded 4.0.1 from Openeuphoria, same result
I have an 4.1 compiled with Watcom, same result
Euphoria to C Translator v4.1.0 development 32-bit Windows, Using Managed Memory Revision Date: 2012-01-14 01:39:09, Id: 5459:426a9ed60258
and at the moment i use (for some other issue that i also can't really trackdown) a 4.0.3 compiled with Watcom.
All show the same behavior. Maybe i do something wrong compiling these binaries, but the binaries that i tried from Openeuphoria act the same way. btw. I would not even call this issue a bug. It's just something you have to know
Thank you Andreas
14. Re: Compiling issue
- Posted by andi49 Feb 07, 2012
- 1661 views
Hallo again
The code below attached to c_decl.e seems to fix the issue, at least here on my system.
function unique_c_name(sequence name) integer i sequence compare_name,fname -- added fname as sequence integer next_fc compare_name = name & ".c" if not TUNIX then compare_name = lower(compare_name) end if next_fc = 1 i = 1 while i <= length(generated_files) do -- extract the base name if not TUNIX then fname=lower(generated_files[i]) -- converting to lower if not on UNIX else fname=generated_files[i] end if if equal(fname, compare_name) then -- name conflict if next_fc > length(file_chars) then CompileErr(140) end if name[1] = file_chars[next_fc] compare_name = name & ".c" if not TUNIX then compare_name = lower(compare_name) end if next_fc += 1 i = 1 -- start over and compare again else i += 1 end if end while return name end function
Andreas