-lcrypto and throw problem

Alvin Ian Paule alvin_ian_paule@yahoo.com
Thu Jan 3 18:06:00 GMT 2002


i have this weird problem concerning the throw
operation.  if my program was linked with the -lcrypto
library, whenever throw was executed, the program
terminates and produces a core dump.  here`s the
program i used (i made it as simple as possible, and
it was saved in the file program.cc):

--------------------------------------------------------
#include <iostream>
#include <string>

using namespace std;

class Program {
public:    
    Program();    
};

Program::Program() {
    throw string("error\n");
}

int main(void)
{   
    try {
        Program p;
    }

    catch (string s) {
        cout << s ;
    }

    return 0;
}
--------------------------------------------------------

here is the makefile i used to compile and link the
program:

--------------------------------------------------------
# COMPILER OPTIONS
CC      = g++
FLG     = -c 
LIB     = -L/usr/local/ssl/lib -lcrypto
COM     = 

# FILE GROUPS
SRC   = program.cc
EXE   = program
OBJ   = program.o

# MAKE OPTIONS
all  : $(OBJ) $(EXE) 
clean: 
	rm -f *.o $(EXE)

# LM OBJECT FILES
program.o    : $(SRC)
	$(CC) $(COM) $(FLG) $(SRC) -o $(OBJ)

# EXECUTABLE FILES
program      : $(OBJ)  
	$(CC) $(OBJ) $(LIB) -o $(EXE)
--------------------------------------------------------

also, as additional info, my compiler is a g++ 3.0.2,
the libcrypto.so is a 0.9.6,  the operating system is
a Solaris 8, and the machine is a Sun Ultra 10.  hope
somebody can help...

alvin

E-mail: alvin_ian_paule@yahoo.com

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com



More information about the Gcc-help mailing list