Heya

First of all I'm totally Linux development newbie.

I'm trying to learn c++ for Linux and I've got a big problem. When I
try to link shared libraries to my program it always outputs
'Segmentation fault' when I try to run it. Of course I was trying to
write something a bit more complicated ;) but after looking for a bug I
removed all code and realized that the bug is not caused my my mistake.

Sample code:
[code]
#include <stdio.h>

int main() {
        printf("ok");
        return 0;
}
[/code]

g++ -c -otestSDL.o testSDLa.cpp
g++ -shared -otestSDLa testSDLa.o
./testSDLa
output: Segmentation fault

g++ -otestSDL.o testSDLa.cpp
./testSDLa
output: ok

gcc version: gcc-4.1.1-1.fc5

thanks

_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to