Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang: error: linker command failed with exit code 1 (use -vto see invocation) #132

Open
MuzafarWani opened this issue Aug 30, 2021 · 0 comments

Comments

@MuzafarWani
Copy link

MuzafarWani commented Aug 30, 2021

Here is a makefile I am trying to run.

VISITHOME=/home/muzafar/Downloads/installations

Set this to the version of VisIt that you use

VISITVERSION=3.1.4

Choose one, depending on your system architecture

#VISITARCH=darwin-x86_64
VISITARCH=linux-x86_64

Edit your compiler and its settings

CXX=clang++
CPPFLAGS=
CXXFLAGS=-O3
LDFLAGS=
LIBS=

#################################################################################
SIMDIR=$(VISITHOME)/$(VISITVERSION)/$(VISITARCH)/libsim/V2

SIM_CXXFLAGS=-I$(SIMDIR)/include
SIM_LDFLAGS=-L$(SIMDIR)/lib
SIM_LIBS=-lsimV2 -ldl

SRC=mandelbrot.C patch.C
OBJ=$(SRC:.C=.o)

SRC_BATCH=mandelbrot_batch.C patch.C
OBJ_BATCH=$(SRC_BATCH:.C=.o)

all: mandelbrot mandelbrot_batch

clean:
rm -f mandelbrot mandelbrot_batch $(OBJ)

mandelbrot: $(OBJ)
$(CXX) -o mandelbrot $(OBJ) $(LDFLAGS) $(SIM_LDFLAGS) $(SIM_LIBS) $(LIBS)

mandelbrot_batch: $(OBJ_BATCH)
$(CXX) -o mandelbrot_batch $(OBJ_BATCH) $(LDFLAGS) $(SIM_LDFLAGS) $(SIM_LIBS) $(LIBS)

.C.o:
$(CXX) $(CXXFLAGS) $(SIM_CXXFLAGS) $(CPPFLAGS) -c $<

and the execution details are been shown as below

muzafar@MUZI:~/Downloads/visit_libsim_mandelbrot_example$ make
clang++ -o mandelbrot mandelbrot.o patch.o -L/home/muzafar/Downloads/installations/3.1.4/linux-x86_64/libsim/V2/lib -lsimV2 -ldl
patch.o: file not recognized: file format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:47: mandelbrot] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant