LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2011, 09:53 AM   #1
aydi
LQ Newbie
 
Registered: Jul 2011
Posts: 7

Rep: Reputation: Disabled
error :ppc_4xx-g++: .exe: No such file or directory?


hello,

i have this make file in order to generate hello.exe.

hello.c compiled with visuel c++.

Code:
#include <iostream>
using namespace std;
void main(void)
{
 //printf("Hello world !!\n");
  cout<<"hello world c++";
}

but i get this error:

creating binary "../bin/hello .exe"
ppc_4xx-g++: .exe: No such file or directory
make: *** [bin] Erreur 1

please some one can help me to solve this problem.

thank you

Code:
###
###     Makefile for hello world c++
###
###             generated for UNIX/LINUX environments
###             by H. Schwarz
###



NAME=   hello 

### include debug information: 1=yes, 0=no
#DBG= 0

DEPEND= dependencies

BINDIR= ../bin
INCDIR= inc
SRCDIR= src
OBJDIR= obj

ADDSRCDIR= ../lcommon/src
ADDINCDIR= ../lcommon/inc

CC=     $(shell which ppc_4xx-g++ ) #contient le nom du compilateur

LIBS=   -lm
CXXFLAGS=  -ffloat-store -Wall -I$(INCDIR) -I$(ADDINCDIR) -D __USE_LARGEFILE64 -D _FILE_OFFSET_BITS=64  #Liste des options de compilation

ifdef DBG
SUFFIX= .dbg
CXXFLAGS+= -g++
else
SUFFIX=
CXXFLAGS+= -O2
endif

OBJSUF= .o$(SUFFIX)

SRC=    $(wildcard $(SRCDIR)/*.c++) 
ADDSRC= $(wildcard $(ADDSRCDIR)/*.c++)
OBJ=    $(SRC:$(SRCDIR)/%.c=$(OBJDIR)/%.o$(SUFFIX)) $(ADDSRC:$(ADDSRCDIR)/%.c=$(OBJDIR)/%.o$(SUFFIX)) 
BIN=    $(BINDIR)/$(NAME)$(SUFFIX).exe


default: depend bin tags

dependencies:
    @echo "" >dependencies

clean:
    @echo remove all objects
    @rm -f $(OBJDIR)/*

tags:
    @echo update tag table
    @ctags inc/*.h src/*.c++

bin:    $(OBJ)
    @echo
    @echo 'creating binary "$(BIN)"'
    @$(CC) -o $(BIN) $(OBJ) $(LIBS)
    @echo '... done'
    @echo

depend:
    @echo
    @echo 'checking dependencies'
    @$(SHELL) -ec '$(CC) -MM $(CXXCFLAGS) -I$(INCDIR) -I$(ADDINCDIR) $(SRC) $(ADDSRC)                  \
         | sed '\''s@\(.*\)\.o[ :]@$(OBJDIR)/\1.o$(SUFFIX):@g'\''               \
         >$(DEPEND)'
    @echo

$(OBJDIR)/%.o$(SUFFIX): $(SRCDIR)/%.c
    @echo 'compiling object file "$@" ...'
    @$(CC) -c -o $@ $(CXXFLAGS) $<

$(OBJDIR)/%.o$(SUFFIX): $(ADDSRCDIR)/%.c++
    @echo 'compiling object file "$@" ...'
    @$(CC) -c -o $@ $(CXXFLAGS) $<


include $(DEPEND)
 
Old 07-15-2011, 10:06 AM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

what did you actually type to start the compilation process?
I looks like you mistyped somewhere 'hello.exe' and put in a space between 'hello' and '.exe':
Code:
creating binary "../bin/hello   .exe"
                              ^ there should be no space here
I exaggerated the space.
 
Old 07-15-2011, 10:07 AM   #3
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
The problem is in how you're defining your variables, because it's picking up a space somewhere. This often happens when you leave a trailing space at the end of a line.

The giveaway is that the result of this command:
Code:
    @echo 'creating binary "$(BIN)"'
Is this... note the space in the filename:

Code:
creating binary "../bin/hello .exe"
Breaking it down, $BIN is defined like so:

Code:
BIN=    $(BINDIR)/$(NAME)$(SUFFIX).exe
BINDIR= ../bin
NAME=   hello 
SUFFIX=
If you go to the end of line in vi, you'll find a trailing space after hello on the NAME= line. You'll see it here in your web browser when you highlight the code with your mouse. Delete it, and that should solve your problem.
 
1 members found this post helpful.
Old 07-15-2011, 10:16 AM   #4
aydi
LQ Newbie
 
Registered: Jul 2011
Posts: 7

Original Poster
Rep: Reputation: Disabled
i remove the space after hello( NAME= hello)


now it appears this problem: creating binary "../bin/hello.exe"
/home/opt//eldk_4.2/usr/../ppc_4xx/usr/lib/crt1.o.rodata+0x4): undefined reference to `main'
collect2: ld returned 1 exit status

thaks
 
Old 07-15-2011, 11:24 AM   #5
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by aydi View Post
i remove the space after hello( NAME= hello)


now it appears this problem:

Code:
creating binary "../bin/hello.exe"
/home/opt//eldk_4.2/usr/../ppc_4xx/usr/lib/crt1.o:(.rodata+0x4): undefined reference to `main'
collect2: ld returned 1 exit status

thaks
It helps to put these things in code tags, so that among other things, we don't end up with the smiley.

Something clearly went wrong in the construction of the variables for this command:

Code:
   @$(CC) -o $(BIN) $(OBJ) $(LIBS)
Because that's the step at which the script is failing, or else we'd have seen "... done" echoed in the output. The path looks like it has been smashed together with some things which are invalid, and I can't begin to help you correct it because I don't know what this command syntax is supposed to look like.

The best way to find syntax problems like this when you're developing a new script is to echo the command string. Then compare that to what you were expecting.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] lfs 6.7 book ch 5.4 binutils 2.20.1 pass 1 error:error: ppl_c.h: No such file or directory frank zhu Linux From Scratch 6 03-04-2011 11:23 AM
Make file error 127 ./config.status: No such file or directory przemekfilu Linux - Newbie 4 11-17-2010 02:06 AM
error while compiling .exe file with wine sanatkrtiwari86 Linux - Software 1 12-24-2008 05:03 AM
samba compatibility with microsoft srvtools.exe (usrmgr.exe and srvmgr.exe) checkmate3001 Linux - Software 1 09-06-2008 05:08 AM
no such file or directory exists when trying to execute a exe ryedawg Linux - Software 5 12-05-2005 05:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration