Hello,
I am trying to create a 32 bit executable on my 64 bit linux machine.
I have the following makefile:
1 2 3 4 5 6 7 8 9 10 11
|
OBJS = Subtract.o
CC = g++
DEBUG = -g
CFLAGS = -fPIC -Wall -m32 -c $(DEBUG)
LFLAGS = -Wall -m32 $(DEBUG) -L/usr/lib64/gcc/x86_64-suse-linux/4.3 -lstdc++
test: $(OBJS)
$(CC) $(LFLAGS) $(OBJS) -o test
Subtract.o : Subtract.cpp
$(CC) $(CFLAGS) Subtract.cpp
|
I am able to create the .o file but not able to create the executable file 'test'.
I am getting the following link error, even though I have specified the path to the library:
g++ -Wall -m32 -g -L/usr/lib64/gcc/x86_64-suse-linux/4.3 -lstdc++ Subtract.o -o test
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libstdc++.so when searching for -lstdc++
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libstdc++.a when searching for -lstdc++
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libstdc++.so when searching for -lstdc++
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.3/libstdc++.a when searching for -lstdc++
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++
collect2: ld returned 1 e
Please help.
H