undefined reference to `__w32_sharedptr_unexpected'

Aaron Patton aaron.patton@welkinsciences.com
Mon Jun 2 17:00:00 GMT 2008


Hi I'm using gcc (g++) and keep getting the following error

I've tried exporting LD_LIBRARY_PATH to the mingw/lib. I've tried adding 
the -Wl, -brtl flag (I'm not sure it I did correctly -- It kept saying 
that it did not recognize the -brtl option)
Anyways, I've run out of ideas. I'm a beginner. So go easy on me.

Thanks

$ make -f Makefile
C:/msys/1.0/mingw/bin/gfortran  -o cirfets CIRFTYPES.o CIRFETS.o 
CIRFCHANS.o CIRFERRS.o CIRFIO.o CIRFPOST.o CIRFSUBS.o libiolib.a 
-lstdc++ -Wl
C:/msys/1.0/mingw/lib/libstdc++.a(eh_throw.o):eh_throw.cc:(.text+0x7b): 
undefined reference to `__w32_sharedptr_unexpected'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_throw.o):eh_throw.cc:(.text+0x8c): 
undefined reference to `__w32_sharedptr_terminate'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0x4e): 
undefined reference to `__w32_sharedptr'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0xb9): 
undefined reference to `__w32_sharedptr'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0x179): 
undefined reference to `__w32_sharedptr'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0x186): 
undefined reference to `__w32_sharedptr'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0x1e3): 
undefined reference to `__w32_sharedptr'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_globals.o):eh_globals.cc:(.text+0x1ef): 
more undefined references to `__w32_sharedptr' follow
C:/msys/1.0/mingw/lib/libstdc++.a(eh_terminate.o):eh_terminate.cc:(.text+0x67): 
undefined reference to `__w32_sharedptr_terminate'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_terminate.o):eh_terminate.cc:(.text+0x97): 
undefined reference to `__w32_sharedptr_unexpected'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_terminate.o):eh_terminate.cc:(.text+0xb3): 
undefined reference to `__w32_sharedptr_terminate'
C:/msys/1.0/mingw/lib/libstdc++.a(eh_terminate.o):eh_terminate.cc:(.text+0xd3): 
undefined reference to `__w32_sharedptr_unexpected'
collect2: ld returned 1 exit status
C:\msys\1.0\mingw\bin\make.exe: *** [cirfets] Error 1

Below is the makefile I'm using

# Directories:
# appdir = ./CIRFETS
# libdir = ./IOLIB
# VPATH = $(appdir):$(libdir)

#
objs = CIRFTYPES.o CIRFETS.o CIRFCHANS.o CIRFERRS.o CIRFIO.o CIRFPOST.o 
CIRFSUBS.o
mods = cirf_types.mod
incs = CIRF.FI CIRFCONST.FI CIRFCHANS.FI CIRFERRS.FI CIRFGRIDS.FI \
       CIRFIO.FI CIRFPOWER.FI CIRFREALZ.FI IMPLICIT.FI
# libs = C:/msys/1.0/mingw/lib/libstdc++.a
libs = -lstdc++ -Wl
# Compiler Rules:
CXX = C:/msys/1.0/mingw/bin/g++
CXXFLAGS =
FC = C:/msys/1.0/mingw/bin/gfortran
FFLAGS = -fno-underscoring
LINK = C:/msys/1.0/mingw/bin/gfortran

# Implicit Rules:
%o: %.cpp
    $(CXX) -c $(CXXFLAGS) $< -o $@

%.o: %.F
    $(FC) -c $(FFLAGS) $< -o $@

# Executable:
cirfets : $(objs) libiolib.a
    $(LINK) -o $@ $(objs) libiolib.a $(libs)
 

# Objects:
CIRFTYPES.o cirf_types.mod : CIRFTYPES.F $(incs)
    $(FC) -c $(FFLAGS) $< -verbose -o $@

CIRFETS.o : CIRFETS.F $(incs)

CIRFCHANS.o : CIRFCHANS.F $(incs)

CIRFERRS.o : CIRFERRS.F $(incs)

CIRFIO.o : CIRFIO.F $(incs)

CIRFPOST.o : CIRFPOST.F $(incs)

CIRFSUBS.o : CIRFSUBS.F $(incs)

# IOLIB Makefile
libiolib.a : ChanIO.o
    ar cru $@ $<

ChanIO.o : ChanIO.cpp ChanIO.h iomacs.h

clean:
    rm -f ChanIO.o libiolib.a
    rm -f cirfets $(objs) $(mods)



More information about the Gcc mailing list