Home » Language IDEs » C / C++ IDE (CDT) » Build fails
Build fails [message #117321] |
Wed, 25 August 2004 16:12  |
Eclipse User |
|
|
|
Originally posted by: mcafee.sympatico.ca
Hi,
I'm new to CDT on Eclipse and need a little help.
Following the instructions in the eclipse help browser, I created a new
"Managed Make c++ Project" and imported a simple c++ file called
"test.cc". Upon building, I get the following error in the console
window...
**** Full rebuild of configuration Release for project test ****
make -k clean all
make: Fatal error in reader: makefile, line 6: Unexpected end of line
seen
Build complete for project test.
--------------------------------------------
The makefile contains the following:
############################################################ ####################
# Automatically-generated file. Do not edit!
############################################################ ####################
ROOT := ..
-include $(ROOT)/makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include $(SUBDIRS:%=%/subdir.mk)
-include objects.mk
-include $(DEPS)
-include $(ROOT)/makefile.defs
all: parking
parking: $(OBJS)
@echo 'Building target: $@'
g++ -o$@ $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building: $@'
clean:
-$(RM) $(OBJS) $(DEPS) parking
PHONY: all clean dependents
-include $(ROOT)/makefile.targets
--------------------------------------------
The project folder is structured as follows:
- test
+ Includes
+ /usr/include
+ /usr/local/include
+ /usr/local/include/c++/3.2.3
+ /usr/local/include/c++/3.2.3/backward
+ /usr/local/include/c++/3.2.3/sparc-sun-solaris2.9
+ /usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.2.3/include
+ Debug
- Release
- makefile
- objects.mk
- sources.mk
- subdir.mk
- test.cc
- iomanip
- iostream
- ...
Looking at the makefile contests, I notice I don't have the following
files:
makefile.init
makefile.defs
makefile.targets
What am I missing...it must be something simple I've overlooked?
Thanks for any help.
|
|
| | |
Re: Build fails [message #117373 is a reply to message #117349] |
Wed, 25 August 2004 20:02   |
Eclipse User |
|
|
|
Mmmm,
Doughnuts. Basically, you can specify the complete path to the gnu make
utility in the location you mentioned, or you could just start
Eclipse/CDT from a shell script that places that path to gmake at the
front of the PATH variable (assuming this does not cause grief in your
particular environment).
I can forsee another problem that we might as well head-off at the pass.
If your GCC compiler gets installed in a location other than default,
the gcc/g++ wrappers will end up calling /usr/ccs/bin/ld (and sometimes
'as') because it finds them in the path and not its own binutils. This
is only a problem when you put Gnu-centric linker commands in the makefile.
We also took the space out between the '-o' flag and the output name,
much to the chagrin of our Mac-using friends. Unfortunately, this also
flumoxes the system linker/assembler on most *nix systems. For 2.0.1,
the space will be back while we work out a better way to specify the
output format of an option via the plugin descriptor. In the meantime,
if you solve the make problem and still see build errors at link time,
you can tell the wrappers where the proper binaries are via the -B flag.
Of course, this may not be a problem for you.
Sean
graeme wrote:
> Sean Evoy wrote:
>
>
>>Graeme,
>>I'll bet you a box of virtual doughnuts that you are using a POSIX make
>>utility. You need Gnu make. Try 'which make' from a shell and see how
>>your path is setup.
>
>
>>Sean
>
>
> Thanks Sean,
>
> You win! Will that be half or full dozen...all chocolate or variety pack?
>
>
> 'which make returns' /usr/ccs/bin/make. I have gmake in /opt/sfw/bin/gmake.
>
> Does this mean I simply need to specify "/opt/sfw/bin/gmake" in the
> "Build Command" text field in the "Make Builder" tab in the preferences
> window, or is it something more involved?
>
>
>
|
|
|
Re: Build fails [message #117587 is a reply to message #117373] |
Thu, 26 August 2004 14:42   |
Eclipse User |
|
|
|
Originally posted by: mcafee.sympatico.ca
Sean Evoy wrote:
> Basically, you can specify the complete path to the gnu make utility
> in the location you mentioned
Done...
> I can forsee another problem that we might as well head-off at the pass.
> If your GCC compiler gets installed in a location other than default,
> the gcc/g++ wrappers will end up calling /usr/ccs/bin/ld (and sometimes
> 'as') because it finds them in the path and not its own binutils. This
> is only a problem when you put Gnu-centric linker commands in the makefile.
This seems ok...
> We also took the space out between the '-o' flag and the output name,
> much to the chagrin of our Mac-using friends. Unfortunately, this also
> flumoxes the system linker/assembler on most *nix systems. For 2.0.1,
> the space will be back while we work out a better way to specify the
> output format of an option via the plugin descriptor.
Yes...this seems to be the problem. From the command line, a space between
'-o' and 'test.o' compiles the source without complaint as such...
g++ -O3 -Wall -c -fmessage-length=0 -o test.o ../test.cc
however from within eclipse I get the error...
**** Full rebuild of configuration Release for project parking ****
gmake -k clean all
rm -rf test.o test.d test
Building file: ../test.cc
g++ -O3 -Wall -c -fmessage-length=0 -otest.o ../test.cc
/usr/ccs/bin/as: error: no input filename given
usage: /usr/ccs/bin/as [-V] [-Q{y,n}] [-f[O][if]#] [-q] [-s]
[-S] [-K {pic,PIC}] [-o objfile] [-L] [-T]
[-P [[-Ipath] [-Dname] [-Dname=def] [-Uname]]...]
[-m [-Ym,path]] [-n] [-ul] [-xF] [-xarch=v7] [-xarch=v8] [-xarch=v8a]
[-xarch=v8plus] [-xarch=v8plusa] [-xarch=v8plusb] [-xarch=v9]
[-xarch=v9a] [-xarch=v9b] [-xcode={pic13,pic32}] file.s...
gmake: *** [test.o] Error 1
gmake: Target `all' not remade because of errors.
Build complete for project test
How can I overcome this prior to CDT v2.0.1? I can't edit the makefile doc
in the Release folder...if I insert a space, it is removed when I rebuild!
Graeme
|
|
|
Re: Build fails [message #117803 is a reply to message #117587] |
Fri, 27 August 2004 13:33   |
Eclipse User |
|
|
|
Graeme,
This is the problem where the Gnu wrapper goes out and invokes as (or
ld) and because of the path setup in your environment as you can see
from the console output, it is calling /usr/ccs/bin/as (thoughtfully
supplied by your system vendor). Now, what you really want to be doing
is calling the binutils from Gnu. Hopefully your sysadmin has them
installed because typically, the GAS and linker are not completely
option-compatible. In any case, you can tell the wrapper where all of
its binaries are located if you pass in the -B<path to your g++ wrapper>
as a compiler and, just to be safe, linker argument.
If the binutils are not there, you can dive into the suggestion in
bugzilla 69575 to see how you can modify the plugin tool spec until
2.0.1 is ready.
graeme wrote:
> Sean Evoy wrote:
>
>
>>Basically, you can specify the complete path to the gnu make utility
>>in the location you mentioned
>
>
> Done...
>
>
>>I can forsee another problem that we might as well head-off at the pass.
>>If your GCC compiler gets installed in a location other than default,
>>the gcc/g++ wrappers will end up calling /usr/ccs/bin/ld (and sometimes
>>'as') because it finds them in the path and not its own binutils. This
>>is only a problem when you put Gnu-centric linker commands in the makefile.
>
>
> This seems ok...
>
>
>>We also took the space out between the '-o' flag and the output name,
>>much to the chagrin of our Mac-using friends. Unfortunately, this also
>>flumoxes the system linker/assembler on most *nix systems. For 2.0.1,
>>the space will be back while we work out a better way to specify the
>>output format of an option via the plugin descriptor.
>
>
> Yes...this seems to be the problem. From the command line, a space between
> '-o' and 'test.o' compiles the source without complaint as such...
>
> g++ -O3 -Wall -c -fmessage-length=0 -o test.o ../test.cc
>
> however from within eclipse I get the error...
>
> **** Full rebuild of configuration Release for project parking ****
>
> gmake -k clean all
> rm -rf test.o test.d test
> Building file: ../test.cc
> g++ -O3 -Wall -c -fmessage-length=0 -otest.o ../test.cc
> /usr/ccs/bin/as: error: no input filename given
> usage: /usr/ccs/bin/as [-V] [-Q{y,n}] [-f[O][if]#] [-q] [-s]
> [-S] [-K {pic,PIC}] [-o objfile] [-L] [-T]
> [-P [[-Ipath] [-Dname] [-Dname=def] [-Uname]]...]
> [-m [-Ym,path]] [-n] [-ul] [-xF] [-xarch=v7] [-xarch=v8] [-xarch=v8a]
> [-xarch=v8plus] [-xarch=v8plusa] [-xarch=v8plusb] [-xarch=v9]
> [-xarch=v9a] [-xarch=v9b] [-xcode={pic13,pic32}] file.s...
> gmake: *** [test.o] Error 1
> gmake: Target `all' not remade because of errors.
> Build complete for project test
>
>
> How can I overcome this prior to CDT v2.0.1? I can't edit the makefile doc
> in the Release folder...if I insert a space, it is removed when I rebuild!
>
> Graeme
>
|
|
|
Re: Build fails [message #117924 is a reply to message #117803] |
Fri, 27 August 2004 20:55   |
Eclipse User |
|
|
|
Originally posted by: mcafee.sympatico.ca
Sean Evoy wrote:
> Graeme,
> This is the problem where the Gnu wrapper goes out and invokes as (or
> ld) and because of the path setup in your environment as you can see
> from the console output, it is calling /usr/ccs/bin/as (thoughtfully
> supplied by your system vendor). Now, what you really want to be doing
> is calling the binutils from Gnu. Hopefully your sysadmin has them
> installed because typically, the GAS and linker are not completely
> option-compatible. In any case, you can tell the wrapper where all of
> its binaries are located if you pass in the -B<path to your g++ wrapper>
> as a compiler and, just to be safe, linker argument.
Well I tried specifying the -B<path to g++ wrapper> option in the Eclipse
preferences panel. Result...same error.
As indicated before, using gcc/g++ to compile this from the command line
works without a hitch, but from within Eclipse it fails. Does the eclipse
IDE/CDT-plugin depend entirely on the GNU utilities? Should I download and
reinstall GNU binutils?
If I can't resolve this soon, I'll have to wait for CDT 2.0.1 :(
Thanks again.
P.S.: platform-OS: Sparc-Solaris9
|
|
|
Re: Build fails [message #118103 is a reply to message #117924] |
Mon, 30 August 2004 10:49  |
Eclipse User |
|
|
|
Graeme,
I do not have enough information to completely solve your problem, but I
suspect that you do not have the Gnu binutils installed on your system.
So long as you stick to basic linker arguments (i.e. g++ -o $@ $<), this
state of affairs usually doesn't effect users because the
system-supplied linker handles most of the situations you are likely to
encounter. What it does not like is the missing space between the ouput
flag and the output argument, whereas the Gnu linker is OK with this (of
course, the MacOS implementation is the exception).
Installing the Gnu binutils would be one relatively simple solution.
Alternatively, there are 2 bugs open on this; 65575 which explains the
root of the problem and two possible work-arounds, and 70788 which has a
couple of other possible work-arounds. As I said, this will be resolved
in 2.0.1 which will be available shortly.
Sean
Graeme wrote:
> Sean Evoy wrote:
>
>
>>Graeme,
>>This is the problem where the Gnu wrapper goes out and invokes as (or
>>ld) and because of the path setup in your environment as you can see
>>from the console output, it is calling /usr/ccs/bin/as (thoughtfully
>>supplied by your system vendor). Now, what you really want to be doing
>>is calling the binutils from Gnu. Hopefully your sysadmin has them
>>installed because typically, the GAS and linker are not completely
>>option-compatible. In any case, you can tell the wrapper where all of
>>its binaries are located if you pass in the -B<path to your g++ wrapper>
>>as a compiler and, just to be safe, linker argument.
>
>
> Well I tried specifying the -B<path to g++ wrapper> option in the Eclipse
> preferences panel. Result...same error.
>
> As indicated before, using gcc/g++ to compile this from the command line
> works without a hitch, but from within Eclipse it fails. Does the eclipse
> IDE/CDT-plugin depend entirely on the GNU utilities? Should I download and
> reinstall GNU binutils?
>
> If I can't resolve this soon, I'll have to wait for CDT 2.0.1 :(
>
> Thanks again.
>
> P.S.: platform-OS: Sparc-Solaris9
>
|
|
|
Goto Forum:
Current Time: Thu May 29 02:21:57 EDT 2025
Powered by FUDForum. Page generated in 0.05141 seconds
|