Author Topic: where is my wrong?  (Read 3150 times)

wy_scorpio (OP)

  • Posts: 368
where is my wrong?
« on: July 20, 2010, 02:27:07 am »
i want try build a "helloword" program on dingux,so i write code with c++ below

#include <iostream>
using namespace std;
int main()
{
    cout<<"hello world!"<<endl;
    return 0;
}


and i build it with "cywin",it creat a "helloworld.dge".
then i run "helloworld.dge" on dingux,but it doesnt run...

where is my wrong?who can tell me?

zear

  • * Moderator
  • Posts: 2381
Re: where is my wrong?
« Reply #1 on: July 20, 2010, 09:44:56 am »
Do you cross compile it, or compile natively for win32?

wy_scorpio (OP)

  • Posts: 368
Re: where is my wrong?
« Reply #2 on: July 23, 2010, 06:42:50 am »
yes,i complie helloworld.cpp passed by cywin,then it make a file "helloworld.dge.exe"
i rename "helloworld.dge.exe" to "helloworld.dge",and copy it to dingux,and run it .
but "helloworld.dge" doesnt run on dingux..
i install cywin on my "win2003 system",and complie "helloworld" on it
« Last Edit: July 23, 2010, 06:46:02 am by wy_scorpio »

Skyline969

  • Posts: 279
Re: where is my wrong?
« Reply #3 on: July 23, 2010, 07:08:44 am »
yes,i complie helloworld.cpp passed by cywin,then it make a file "helloworld.dge.exe"
i rename "helloworld.dge.exe" to "helloworld.dge",and copy it to dingux,and run it .
but "helloworld.dge" doesnt run on dingux..
i install cywin on my "win2003 system",and complie "helloworld" on it
.exe is a Windows file format. To me, it seems like it's compiling for Win32, not for whatever .dge is.

zear

  • * Moderator
  • Posts: 2381
Re: where is my wrong?
« Reply #4 on: July 23, 2010, 10:21:04 am »
Do you use dingux toolchain? So far it sounds like you compile it with win32 gcc.
Run the following command to find out what architecture is the binary compiled for:
Code: [Select]
file ./helloworld.dge

wy_scorpio (OP)

  • Posts: 368
Re: where is my wrong?
« Reply #5 on: July 23, 2010, 10:47:11 am »
i use cywin which is SiENcE ported.
is "makefile" wrong?
below is my "makefile"

TOOLCHAINDIR := /dingux
BINPATH    := $(TOOLCHAINDIR)/bin
LIBPATH    := $(TOOLCHAINDIR)/lib

INCLUDES := -I${TOOLCHAINDIR}/mipsel-linux-uclibc/include/

ARCH   := mipsel-linux-uclibc-
CC      := ${BINPATH}/$(ARCH)gcc
SOURCES := *.o

PROGRAM = hello
TARGET   := hello.dge
VERSION   =   1.0

all: $(PROGRAM)
   mv $(PROGRAM) $(TARGET)

clean:
   rm -f $(TARGET) *.o *~


« Last Edit: July 23, 2010, 11:01:00 am by wy_scorpio »

wy_scorpio (OP)

  • Posts: 368
Re: where is my wrong?
« Reply #6 on: July 23, 2010, 11:03:20 am »
Do you use dingux toolchain? So far it sounds like you compile it with win32 gcc.
Run the following command to find out what architecture is the binary compiled for:
Code: [Select]
file ./helloworld.dge


"file ./hello.dge"
is the code  run on cywin's dos?

zear

  • * Moderator
  • Posts: 2381
Re: where is my wrong?
« Reply #7 on: July 23, 2010, 12:05:45 pm »
file is a linux command, so you should run it from the cygwin shell.

 

Post a new topic
Post a new topic