1. Compile

euc runs to these lines in command.com:

Compiling with Watcom

Compiling 0% init-.c

Couldn't compile file 'init-.c'

Status: -1 Command: wcc386 /dEWINDOWS /bt=nt /mf /w0 /zq /j /zp4 /fp5 /fpi87 /5r /otimra /s /Ic:\Euphoria init-.c

I did run the batch file in the watcom root folder so I am assuming it was setup correctly.

Any ideas?

Buzzo

new topic     » topic index » view message » categorize

2. Re: Compile

Could it be that wcc386 is not in your PATH?

new topic     » goto parent     » topic index » view message » categorize

3. Re: Compile

the path for WATCOM is C:\Euphoria\watcom

This should be correct

new topic     » goto parent     » topic index » view message » categorize

4. Re: Compile

Changed from watcom to MinGW

compiled using this command: euc -gcc -lflags "-mwindows c:\euphoria\bin\eu.a -mu3" -lib C:\euphoria\bin\eu.a c:\Euphoria\<prog name>

Compiled just fine.

Buzzo

new topic     » goto parent     » topic index » view message » categorize

5. Re: Compile

Compiled, but will not run... larger file than using bind..

Oh well..

Buzzo

new topic     » goto parent     » topic index » view message » categorize

6. Re: Compile

buzzo said...

Compiled, but will not run...

I've had a lot of issues with MinGW lately. Try switching to TDM-GCC instead.

C:\Euphoria\Downloads\wee>gcc -v 
Using built-in specs. 
COLLECT_GCC=mingw32-gcc 
COLLECT_LTO_WRAPPER=C:/tdm-gcc-32/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe 
Target: mingw32 
Configured with: ../../../src/gcc-4.8.1/configure --build=mingw32 --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-fully-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --with-pkgversion=tdm-2 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.tdragon.net/bugs 
Thread model: posix 
gcc version 4.8.1 (tdm-2) 

C:\Euphoria\Downloads\wee>euc -gcc -makefile -nobuild WEE.EXW 
Translating code, pass: 1 2 3 4 5 6 7  generating 
 
12.c files were created. 
To build your project, type make -f WEE.mak 

C:\Euphoria\Downloads\wee>mingw32-make -f WEE.mak 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math init-.c -o init-.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math WEE.c -o WEE.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math main-.c -o main-.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math parser.c -o parser.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math file.c -o file.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math sort.c -o sort.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math scintilla.c -o scintilla.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math dll.c -o dll.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math machine.c -o machine.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math get.c -o get.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math ui_win.c -o ui_win.o 
gcc -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -O2 -m32 -IC:/Euphoria -ffast-math window.c -o window.o 
gcc -o C:/Euphoria/DOWNLO~1/wee/WEE.exe init-.o WEE.o main-.o parser.o file.o sort.o scintilla.o dll.o machine.o get.o ui_win.o window.o  C:/Euphoria/bin/eu.a -m32 

buzzo said...

larger file than using bind..

This happens, unfortunately. You can use UPX to compress your exectuables.

C:\Euphoria\Downloads\wee>upx WEE.exe 
                       Ultimate Packer for eXecutables 
                          Copyright (C) 1996 - 2013 
UPX 3.91w       Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 30th 2013 
 
        File size         Ratio      Format      Name 
   --------------------   ------   -----------   ----------- 
    726330 ->    405306   55.80%    win32/pe     WEE.exe 
 
Packed 1 file. 

-Greg

new topic     » goto parent     » topic index » view message » categorize

7. Re: Compile

Greg,

Using TDM-gcc compiled ok.. Runs ok with one exception.. Will study the source code..

Again, thanks,

Buzzo

new topic     » goto parent     » topic index » view message » categorize

8. Re: Compile

ghaberek said...
buzzo said...

larger file than using bind..

This happens, unfortunately. You can use UPX to compress your exectuables.

An additional note on this: The shrouder [and binder] will remove any routines and variables that your program doesn't use. The translator, conversely, will not remove any unused routines. So if you are translating with a large library (e.g. Win32Lib) then you will see a much larger executable.

If you use the -nobuild and -makefile options, you can edit your make file and change the -O2 (Full optimization) option to -Os (Optimize space usage) on the CFLAGS line. Using this option, you can probably save about 5-10%, which will carry through to the UPX-compressed executable as well.

CFLAGS = -DEWINDOWS -fomit-frame-pointer -c -w -fsigned-char -Os -m32 -IC:/Euphoria -ffast-math 

Also, when compiling with MinGW or TDM-GCC, you may notice a console window show up on compiled Windows apps. You can add the -mwindows option to your LFLAGS line to avoid this.

LFLAGS = C:/Euphoria/bin/eu.a -m32 -mwindows 

-Greg

new topic     » goto parent     » topic index » view message » categorize

9. Re: Compile

Traced the problem within the source code..

It seems that a win32Lib "Combo" has been the source of failed compiles..

The program starts with a combo for the user to chose a database to use..

Could not get past it as I had disabled menu items pending this selection..

Have changed to a list and now all is well..

upx changes file size to about 33% of the original..

Thanks for all your help,

Buzzo

new topic     » goto parent     » topic index » view message » categorize

10. Re: Compile

buzzo said...

Traced the problem within the source code..

It seems that a win32Lib "Combo" has been the source of failed compiles..

The program starts with a combo for the user to chose a database to use..

Could not get past it as I had disabled menu items pending this selection..

Have changed to a list and now all is well..

I wonder if this is a Common Controls version problem. The euiw exectuable is compiled with a "manifest" file that sets the Common Controls version to 6.0, and without this, your compiled application uses the older versions. This is what makes tabs and other controls look "old" like Windows 9x. You can easily inject a manifest to your executable during the call to euc.

Save this as file.exe.manifest (matching your exectuable file name). Make sure to update the fields as necessary.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <assemblyIdentity 
        processorArchitecture="x86" 
        version="5.1.0.0" 
        type="win32" 
        name="foo.exe"/> 
    <description>Foo program</description> 
    <dependency> 
    <dependentAssembly> 
    <assemblyIdentity 
        type="win32" 
        name="Microsoft.Windows.Common-Controls" 
        version="6.0.0.0" 
        publicKeyToken="6595b64144ccf1df" 
        language="*" 
        processorArchitecture="x86"/> 
    </dependentAssembly> 
    </dependency> 
</assembly> 

Save this as file.rc (again, update to match your actual file name).

1 24 "file.exe.manifest" 

And then add -rc-file=file.rc in your call to euc.

-Greg

new topic     » goto parent     » topic index » view message » categorize

11. Re: Compile

ghaberek said...

An additional note on this: The shrouder [and binder] will remove any routines and variables that your program doesn't use. The translator, conversely, will not remove any unused routines. So if you are translating with a large library (e.g. Win32Lib) then you will see a much larger executable.

This is totally wrong. In fact, the translator is likely to remove more things from your code. It makes several passes until it can no longer remove anything (more or less, there are other optimizations involved).

You may be thinking about translating into a shared / dynamic library, which has different rules, since the point is to make stuff available for use later on. But even then, things are removed during translation.

Matt

new topic     » goto parent     » topic index » view message » categorize

12. Re: Compile

mattlewis said...

This is totally wrong. In fact, the translator is likely to remove more things from your code. It makes several passes until it can no longer remove anything (more or less, there are other optimizations involved).

You may be thinking about translating into a shared / dynamic library, which has different rules, since the point is to make stuff available for use later on. But even then, things are removed during translation.

Interesting. I couldn't find anything supporting that in the translator documentation. Conversely, the the binder documentation does specifically state this.

My misunderstanding was also supported by the translator not outputting the phrase "deleted [n] unused routines..."

Translator

C:\Euphoria\Downloads\wee>euc -nobuild -makefile WEE.EXW 
Translating code, pass: 1 2 3 4 5 6 7 8 9 10 11  generating 
 
38.c files were created. 
To build your project, type make -f WEE.mak 

Binder

C:\Euphoria\Downloads\wee>eubind WEE.EXW 
deleted 405 unused routines and 3037 unused variables. 
You may now run C:\Euphoria\Downloads\wee\WEE.exe 

I am probably not the only one who was mistaken. Maybe we need to update the documentation?

-Greg

new topic     » goto parent     » topic index » view message » categorize

13. Re: Compile

Hallo,

ghaberek said...

[...}

I am probably not the only one who was mistaken. Maybe we need to update the documentation?

-Greg

from:

http://openeuphoria.org/docs/e2c.html#_624_executablesizeandcompression

[...]
The Translator deletes routines that are not used, including those from the standard Euphoria include files. After deleting unused routines, it checks again for more routines that have now become unused, and so on. This can make a big difference, especially with Win32Lib-based programs where a large file is included, but many of the included routines are not used in a given program.
[...]

Andreas

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu