How to config the GDC on linux target for ARM linux?

FrankLike via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 27 20:52:44 PST 2015


Now I build a project for ARM linux on ubuntu 15.04 ,but build 
error.
I download the 'wiringPi' from http://wiringPi.com,convert the 
*.h to *.d.then build the 'aa.so' file:
#! /bin/sh
dfiles="max31855.d max5322.d mcp23008.d mcp23016.d mcp23016reg.d 
mcp23017.d mcp23s08.d mcp23s17.d mcp23x08.d mcp23x0817.d 
mcp3002.d mcp3004.d mcp3422.d mcp4802.d pcf8574.d pcf8591.d 
sn3218.d softPwm.d softServo.d softTone.d sr595.d wiringPi.d 
wiringPiI2C.d wiringPiSPI.d wiringSerial.d wiringShift.d 
wpiExtensions.d"

ofiles="drcSerial.o max31855.o max5322.o mcp23008.o mcp23016.o  
mcp23017.o mcp23s08.o mcp23s17.o mcp3002.o mcp3004.o mcp3422.o 
mcp4802.o pcf8574.o pcf8591.o piHiPri.o piThead.o sn3218.o 
softPwm.o softServo.o softTone.o sr595.o wiringPi.o wiringPiI2C.o 
wiringPiSPI.o wiringSerial.o wiringShift.o wpiExtensions.o"

  /opt/arm-unknown-linux-gnueabihf/bin/arm-linux-gnueabihf-gdc  -o 
aa.so $ofiels $dfiles  -shared
---------------------------------------my.d
import wiringPi;
import std.stdio;

void main()
{
	writeln("start");
	wiringPiSetup();
	pinMode(0,OUTPUT);
	while(1)
	{
		digitalWrite(0,HIGH);
		delay(500);
		digitalWrite(0,LOW);
		delay(500);
	}
return;
}
-------------------------------------build the my execute file
/opt/arm-unknown-linux-gnueabihf/bin/arm-linux-gnueabihf-gdc  -o 
my  my.d aa.so -I./wiringPi/WiringPi/

---------------------now get the error:
my.d:1:8: error: module wiringPi is in file 'wiringPi.d' which 
cannot be read
  import wiringPi;
         ^
import path[0] = 
/opt/arm-unknown-linux-gnueabihf/lib/gcc/arm-unknown-linux-gnueabihf/5.2.0/include/d
---------------------I copy the *.d to 
/opt/arm-unknown-linux-gnueabihf/lib/gcc/arm-unknown-linux-gnueabihf/5.2.0/include/d
it's ok ,but where is the file for config?
---------------------get another error:
/tmp/cc7M1B9I.o: In function `_Dmain':
my.d:(.text+0x60): undefined reference to `wiringPiSetup'
my.d:(.text+0x6c): undefined reference to `pinMode'
my.d:(.text+0x84): undefined reference to `digitalWrite'
my.d:(.text+0x8c): undefined reference to `delay'
my.d:(.text+0x98): undefined reference to `digitalWrite'
my.d:(.text+0xa0): undefined reference to `delay'
collect2: error: ld returned 1 exit status
---------------------------------end

I'm not known the GDC config file ,and maybe I use the error 
build .
Who can help me?
  thank you.





More information about the Digitalmars-d-learn mailing list