digitalmars.D - Error importing std.socket ?
- SeeSchloss (29/29) May 09 2004 Hi everybody,
- Mike Swieton (9/41) May 09 2004 You need a main method. You'll find that you get that error upon importi...
- SeeSchloss (8/14) May 09 2004 OMG, I'm so ashamed :-/
- Regan Heath (6/21) May 09 2004 We all do something like this every now and again :)
- Phill (7/31) May 09 2004 You mean somthing like the following, which is written in the third line...
- Regan Heath (5/32) May 09 2004 Yes, without the others.. so it's clear.
Hi everybody, I've been trying to use sockets now that they are included in phobos, but I must have forgotten to do something somewhere. When I try to compile a file containing just "import std.socket;" in it, dmd spits out a bunch of errors I don't really understand : gcc sockets.o -o sockets -lphobos -lpthread -lm /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(dmain2.o)(.gnu.l nkonce.tmain+0x64): In function `main': : undefined reference to `_Dmain' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh21 DHandlerTable+0x4): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_beg' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh21 DHandlerTable+0xc): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_beg' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh213 HandlerTable+0x13): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_end' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh213 HandlerTable+0x37): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_end' collect2: ld returned 1 exit status --- errorlevel 256 /usr/lib/libphobos.a is the last libphobos.a from the 0.88 zip archive. Anyone knows where the problem could come from ? (I probably overlooked something evident somewhere :) Thanks. -- Schee
May 09 2004
You need a main method. You'll find that you get that error upon importing any module. Try adding: int main(char[][] args) { return 0; } to your file. On Sun, 09 May 2004 19:07:24 +0200, SeeSchloss wrote:Hi everybody, I've been trying to use sockets now that they are included in phobos, but I must have forgotten to do something somewhere. When I try to compile a file containing just "import std.socket;" in it, dmd spits out a bunch of errors I don't really understand : gcc sockets.o -o sockets -lphobos -lpthread -lm /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(dmain2.o)(.gnu.l nkonce.tmain+0x64): In function `main': : undefined reference to `_Dmain' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh21 DHandlerTable+0x4): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_beg' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh21 DHandlerTable+0xc): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_beg' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh213 HandlerTable+0x13): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_end' /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../libphobos.a(deh2.o)(.gnu.linkonce.t_D4deh213__eh_finddataFPvZPS4deh213 HandlerTable+0x37): In function `_D4deh213__eh_finddataFPvZPS4deh213DHandlerTable': : undefined reference to `_deh_end' collect2: ld returned 1 exit status --- errorlevel 256 /usr/lib/libphobos.a is the last libphobos.a from the 0.88 zip archive. Anyone knows where the problem could come from ? (I probably overlooked something evident somewhere :) Thanks.Mike Swieton __ The difference between losers and winners is that losers don't fail enough. - Ross Jeffries
May 09 2004
Mike Swieton wrote:You need a main method. You'll find that you get that error upon importing any module. Try adding: int main(char[][] args) { return 0; } to your file.OMG, I'm so ashamed :-/ Actually I accidentaly launched a compilation before writing anything else, and after seeing the errors I didn't even try to go further... Well, next time I'll ponder a bit before getting in panic :) Thanks -- Schee
May 09 2004
On Sun, 09 May 2004 20:18:52 +0200, SeeSchloss <seeschloss seeschloss.org> wrote:Mike Swieton wrote:We all do something like this every now and again :)You need a main method. You'll find that you get that error upon importing any module. Try adding: int main(char[][] args) { return 0; } to your file.OMG, I'm so ashamed :-/Actually I accidentaly launched a compilation before writing anything else, and after seeing the errors I didn't even try to go further...If the compiler error was clearer...Well, next time I'll ponder a bit before getting in panic :) Thanks -- Schee-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 09 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr7q59gfy5a2sq9 digitalmars.com...On Sun, 09 May 2004 20:18:52 +0200, SeeSchloss <seeschloss seeschloss.org> wrote:You mean somthing like the following, which is written in the third line of the error? " In function `main': : undefined reference to `_Dmain' " PhillMike Swieton wrote:We all do something like this every now and again :)You need a main method. You'll find that you get that error upon importing any module. Try adding: int main(char[][] args) { return 0; } to your file.OMG, I'm so ashamed :-/Actually I accidentaly launched a compilation before writing anything else, and after seeing the errors I didn't even try to go further...If the compiler error was clearer...Well, next time I'll ponder a bit before getting in panic :) Thanks -- Schee-- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
May 09 2004
On Mon, 10 May 2004 09:32:10 +1000, Phill <phill pacific.net.au> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opr7q59gfy5a2sq9 digitalmars.com...Yes, without the others.. so it's clear. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/On Sun, 09 May 2004 20:18:52 +0200, SeeSchloss <seeschloss seeschloss.org> wrote:You mean somthing like the following, which is written in the third line of the error? " In function `main': : undefined reference to `_Dmain' "Mike Swieton wrote:We all do something like this every now and again :)You need a main method. You'll find that you get that error upon importing any module. Try adding: int main(char[][] args) { return 0; } to your file.OMG, I'm so ashamed :-/Actually I accidentaly launched a compilation before writing anything else, and after seeing the errors I didn't even try to go further...If the compiler error was clearer...
May 09 2004