0

Following the readme for the installation, I'm stuck on point 5. After changing the path of z3, I get different errors when I execute 'make'.

ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I've found this thread that specifies this kind of error. It seems that it's impossible to solve the error since, the use of 'static'. I report the message from the the thread:

This option will not work on Mac OS X unless all libraries (including libgcc.a) 
have also been compiled with -static. Since neither a static version of libSystem.dylib 
nor crt0.o are provided, this option is not useful to most people.

This is the Makefile that I used.

Z3_path = /Users/mat/z3
JUNK = str
SOURCE = *.cpp
INCLUDE = $(Z3_path)/lib
LIB = $(Z3_path)/bin/external

all: $(SOURCE)
    @echo ">> Z3 Source Dir: "$(Z3_path)
    @echo ""
    g++ -O3 -std=c++11 -I$(INCLUDE) -L$(LIB) $(SOURCE) -lz3 -o str -Wall
    @echo ""

clean:
    rm -f $(JUNK)
Community
  • 1
  • 1
marco
  • 51
  • 3
  • Will that `*.cpp` work? Have you tried `$(wildcard *.cpp)`? – trojanfoe Jan 03 '16 at 18:19
  • Yes. I've the same problem anyway. – marco Jan 03 '16 at 21:17
  • Personaally, I would use `homebrew` to install Z3 for me - it does a really good job of everything else on a Mac. – Mark Setchell Jan 03 '16 at 23:03
  • You're right, but to install Z3-str you need to compile the source code of Z3. I'm just following the documentation of Z3-str. – marco Jan 04 '16 at 13:21
  • Can you compile from the command-line, without using `make` in order to rule that out? – Mark Setchell Jan 04 '16 at 22:22
  • Do you mean this? `g++ -O3 -std=c++11 -I/Users/mat/z3/lib -L/Users/mat/z3/bin/external strArgmt.cpp strAstReduce.cpp strMain.cpp strRegex.cpp strTheory.cpp -lz3 -o str -Wall`. I obtain this: `ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)` – marco Jan 04 '16 at 23:37

0 Answers0