[PD-dev] Cross Compiling External for Windows - Problem

Thomas Mayer thomas at residuum.org
Fri Aug 10 21:01:52 CEST 2012


Hi,

On 10.08.2012 11:20, Patrice Colet wrote:
> Hello, I'm afraid the work to be made isn't in the Makefile but in source files,
> 
> did you give a try with this:
> 
> http://readlist.com/lists/lists.sourceforge.net/mingw-users/1/9807.html

I don't think, this is the problem: There is no MSVC involved in the
entire toolchain, but only gcc on Linux, partly using MXE for cross
compilation on Linux.

PuREST JSON builds fine in Linux for Linux.
The needed libraries build fine in Linux with MXE, the test applications
for the libraries work.
PuREST JSON compiles fine in Linux with MXE, but linking does not work.

Best regards,
Thomas

> Colet Patrice
> 
> ----- Mail original -----
>> De: "Thomas Mayer" <thomas at residuum.org>
>> À: pd-dev at iem.at
>> Envoyé: Vendredi 10 Août 2012 10:49:15
>> Objet: [PD-dev] Cross Compiling External for Windows - Problem
>>
>> Hello,
>>
>> I try to cross compile my external PuREST JSON for Windows using MXE
>> on
>> Linux. According to their tutorial, a little work is necessary on the
>> Makefile to be able to cross-compile (http://mxe.cc/#tutorial):
>>
>> -- Start quote --
>> Step 5d: Cross compile your Project (Makefile)
>>
>> If you have a handwritten Makefile, you probably will have to make a
>> few
>> adjustments to it:
>>
>> CC=$(CROSS)gcc
>> LD=$(CROSS)ld
>> AR=$(CROSS)ar
>> PKG_CONFIG=$(CROSS)pkg-config
>>
>> You may have to add a few others, depending on your project.
>>
>> Then, all you have to do is:
>>
>> make CROSS=i686-pc-mingw32-
>>
>> That's it!
>> -- End     quote --
>>
>> That is, what I tried, and compilation is working, but the linker
>> does
>> not work, and outputs:
>>
>> i686-pc-mingw32-gcc -shared -o libpurest_json.dll libpurest_json.o
>> -lcurl -ljson -L"/home/thomas/src/Pd-0.42.5-extended/pd-win/src"
>> -L"/home/thomas/src/Pd-0.42.5-extended/pd-win/bin"
>> -L"/home/thomas/src/Pd-0.42.5-extended/pd-win/obj" -lpd -lwsock32
>> -lkernel32 -luser32 -lgdi32 -liberty -lpthread
>> libpurest_json.o: In function `output_json':
>> /home/thomas/src/pd/my-objects/purest_json/libpurest_json.c:145:
>> undefined reference to `s_list'
>> /opt/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-mingw32/lib/libjson.a(printbuf.o):
>> In function `vasprintf':
>> /opt/mxe/tmp-json-c/json-c-0.10/printbuf.c:130: undefined reference
>> to
>> `_vscprintf'
>> /opt/mxe/usr/lib/gcc/i686-pc-mingw32/4.7.1/../../../../i686-pc-mingw32/lib/libmingwex.a(pformat.o):pformat.c:(.text+0x1732):
>> undefined reference to `_get_output_format'
>> collect2: error: ld returned 1 exit status
>> make: *** [libpurest_json.dll] Fehler 2
>>
>> I have pd.dll in the path
>> /home/thomas/src/Pd-0.42.5-extended/pd-win/bin.
>>
>> The complete Makefile and input / output of make is at
>> https://gist.github.com/3307768
>>
>> Here are my questions:
>> Does gcc use the wrong linker (ld instead of i686-pc-mingw32-ld)?
>> Is there a way to force gcc to use the correct linker?
>> Do I something else than pd.dll for linking?
>>
>> Thanks in advance,
>> Thomas
>> --
>> "Theoretically, [the amount of money in circulation] is watched
>> carefully by clever, serious economists. In practice, all the world's
>> money is one big swirling, whirling pool." (Cory Doctorow - For The
>> Win)
>> http://www.residuum.org/
>>
>>
>> _______________________________________________
>> Pd-dev mailing list
>> Pd-dev at iem.at
>> http://lists.puredata.info/listinfo/pd-dev
>>


-- 
"From the perspective of communication analysis, government is not
an instrument of law and order, but of law and disorder." (Gracchus
Gruad in: Robert Shea & Robert A. Wilson, The Golden Apple)
http://www.residuum.org/



More information about the Pd-dev mailing list