1. compiling issue on link using the -plat option with TDM-GCC-64

Hi everybody, I try to compile for Linux using -plat a small testcl.ex on my Windows10 PC. I get the message : cannot find -ldl . I suppose there is a missing library ? I cannot find out which one and where to get it. Maybe some of you have an idea about that . Thanks for help !

c:\Euphoria\Cltest>euc -GCC -plat LINUX testcl.ex 
Build directory: build-985871\ 
Translating code, pass: 1 2 3 4 5 6 7 8 9 10 11  generating 
Compiling with GCC 
Compiling   3% init-.c 
... 
... 
Compiling  96% sort.c 
Linking 100% ..\testcl 
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldl 
collect2.exe: error: ld returned 1 exit status 
Unable to link c:\Euphoria\Cltests\testcl 
Status: 1 Command: gcc -o c:/Euphoria/Cltests/testcl  init-.o testcl.o main-.o machine.o memory.o dll.o types.o conver 
t.o search.o filesys.o datetime.o get.o scinot.o sequence.o sort.o   C:/Euphoria/bin/eu.a -m32 -ldl -lm -lpthread 

new topic     » topic index » view message » categorize

2. Re: compiling issue on link using the -plat option with TDM-GCC-64

clkeriolet said...

Hi everybody, I try to compile for Linux using -plat a small testcl.ex on my Windows10 PC. I get the message : cannot find -ldl . I suppose there is a missing library ? I cannot find out which one and where to get it. Maybe some of you have an idea about that . Thanks for help !

Unfortunately, cross-compiling just isn't that straight-forward. Some of the translator options, like -arch and -plat, seem to exist purely for use in building Euphoria itself.

It should possible to cross-compile applications from Linux to Windows by using -plat and -cc-prefix, but I doubt it'll work the other way around. You'd need a Linux compiler that runs on Windows and TDM-GCC is built for Windows.

-Greg

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

3. Re: compiling issue on link using the -plat option with TDM-GCC-64

Thanks a lot Greg for your answer, I am not used to linux, so what is the best linux like compiler for Euphoria ?

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

4. Re: compiling issue on link using the -plat option with TDM-GCC-64

clkeriolet said...

Thanks a lot Greg for your answer, I am not used to linux, so what is the best linux like compiler for Euphoria ?

TDM-GCC is the best compiler to use for Euphoria on Windows. The problem is that you can't compile for Linux on Windows. (But you can typically compile for Windows on Linux.)

On Linux, you'd also use GCC, which is the native compiler. I recommend using Linux Mint. Just install the build-essential package to get GCC and everything else you need like make, etc.

-Greg

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

5. Re: compiling issue on link using the -plat option with TDM-GCC-64

ghaberek said...
clkeriolet said...

Hi everybody, I try to compile for Linux using -plat a small testcl.ex on my Windows10 PC. I get the message : cannot find -ldl . I suppose there is a missing library ? I cannot find out which one and where to get it. Maybe some of you have an idea about that . Thanks for help !

Unfortunately, cross-compiling just isn't that straight-forward. Some of the translator options, like -arch and -plat, seem to exist purely for use in building Euphoria itself.

Specifically, they are for cross-translation of the Euphoria interpreter and translator: the idea being that you can't run the Euphoria interpreter or translator binaries on a new platform (like OpenSolaris) but you can translate the source to C and then run gcc on the native platform to finish the build.

My recollection is that this didn't work very well. Often we'd have to temporary hardcode a hack in the Eu source before cross-translationg it or else the binary wouldpartly behave as if it was on the host platform.

ghaberek said...

It should possible to cross-compile applications from Linux to Windows by using -plat and -cc-prefix, but I doubt it'll work the other way around. You'd need a Linux compiler that runs on Windows and TDM-GCC is built for Windows.

-Greg

It's technically possible, but probably more trouble than it's worth. You'd likely have to build your own cross compiler for GNU/Linux on Window using a Windows port of GCC. Which is certainly possible, but a lot of hard work. (If you want to take a look at what would be involved, see https://stackoverflow.com/questions/4769968/c-cross-compiler-from-windows-to-linux/4770417#4770417 )

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

Search



Quick Links

User menu

Not signed in.

Misc Menu