Message: Re: GNUmakefile problem Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GNUmakefile problem 

Forum: Installation and Configuration
Re: Question GNUmakefile problem (Lukas Schulte)
Date: 08 Sep, 2010
From: Michael H. Kelsey <Michael H. Kelsey>

On Mon, 06 Sep 2010 14:12:12 GMT, Lukas Schulte wrote:
> Hi all! I have a problem compiling my own program, obviously in the
> GNUmakefile. It gives the following error:
> 
> Using global libraries ... Linking CSim
> /usr/lib/gcc/i486-linux-gnu/4.3.2/../../../../lib/crt1.o: In function
> `_start': (.text+0x18): undefined reference to `main' collect2: ld
> returned 1 exit status
> 
> This very problem was already posted earlier (
> http://hypernews.slac.stanford.edu:5090/HyperNews/geant4/get/installconfig/68.html
> ) and there seems to be a simple solution as one can see out of the
> comments to that posting, the solution was not posted there...
> 
> And before I forget, my GNUmakefile is adopted from the exampleN01
> makefile simply by changing the name and reads as follows:

A simple, and probably dumb, question: In your directory, do you have the file with your main() named CSim.cc? That's what the Make system looks for to actually compile and link the executable. The rule is that the top-level source file has to be named as $G4TARGET.

> # $Id: GNUmakefile,v 1.1 1999/01/07 16:05:40 gunter Exp $
> # --------------------------------------------------------------
> # GNUmakefile for examples module.  Gabriele Cosmo, 06/04/98.
> # --------------------------------------------------------------
> #
> # adopted for CSim Cherenkov Light Simulator
> # Lukas Schulte, 08/2010
> 
> name := CSim 
> G4TARGET := $(name) 
> G4EXLIB := true
> 
> ifndef G4INSTALL
>   G4INSTALL = ../../..
> endif
> 
> .PHONY: all all: lib bin
> 
> include $(G4INSTALL)/config/binmake.gmk

 Add Message Add Message
to: "Re: GNUmakefile problem"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]