www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - compile/link problems(real newbie question)

reply Munchgreeble bigfoot.com writes:
Hi There,

I've tried quite a few different ways of getting my first D program to compile -
I finally got it going on the command line (Cygwin), but Code::Blocks just
doesn't want to play ball. I've tried looking on a couple of the different FAQs
around, but none of them seem to answer basic questions about common compiler
problems. I know I know, once I get this working I should go update the wiki so
that the next poor soul who comes along can have some assistance. I will try to
get around to that!

OK, so I'm on WinXP. My two current ways of attempting a build are in
Code::Blocks with the D modified binary (as indicated here:
http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport#CodeBlocks) and also from
the commandline in Cygwin, using Vim (which now comes with D syntax highlighting
as standard - hoorah). I've got past a few errors (working out what needed to be
where for some of the hardcoded relative paths to work, complaints about
corrupted libraries etc.) but I'm left with this in Code::Blocks and I'm stuck:

Project   : Console application
Compiler  : Digital Mars D Compiler (called directly)
Directory : C:\d-projects\first\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: first.d
Linking console executable: C:\Documents and Settings\raf\My
Documents\d-projects\first\first.exe
link /nologo /delexe .objs\first.obj C:\dmd\lib\phobos.lib C:\dmd\lib\WS2_32.LIB
C:\dm\lib\snn.lib ,C:\Documents and Settings\raf\My
Documents\d-projects\first\first.exe,,C:\dmd\lib\\ C:\dm\lib\\ ,
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB0EH Record Type 0091 
Error 1: Previous Definition Different : __init_10TypeInfo_D
C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB28H Record Type 0091 
Error 1: Previous Definition Different : __Class_10TypeInfo_D
C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB41H Record Type 0091 
Error 1: Previous Definition Different : __vtbl_10TypeInfo_D
C:\dmd\lib\phobos.lib(ti_creal)  Offset 6DFEBH Record Type 0091 
Error 1: Previous Definition Different : __init_10TypeInfo_c
C:\dmd\lib\phobos.lib(ti_creal)  Offset 6E005H Record Type 0091 
Error 1: Previous Definition Different : __Class_10TypeInfo_c
C:\dmd\lib\phobos.lib(ti_creal)  Offset 6E01EH Record Type 0091 
Error 1: Previous Definition Different : __vtbl_10TypeInfo_c
C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB20H Record Type 0091 
Error 1: Previous Definition Different : __init_10TypeInfo_p
C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB3AH Record Type 0091 
Error 1: Previous Definition Different : __Class_10TypeInfo_p
C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB53H Record Type 0091 
Error 1: Previous Definition Different : __vtbl_10TypeInfo_p
C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 76457H Record Type 0091 
Error 1: Previous Definition Different : __init_11TypeInfo_Ac
C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 76472H Record Type 0091 
Error 1: Previous Definition Different : __Class_11TypeInfo_Ac
C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 7648CH Record Type 0091 
Error 1: Previous Definition Different : __vtbl_11TypeInfo_Ac
C:\dmd\lib\WS2_32.LIB Offset 01A95H Record Type 0088 
Error 1: Previous Definition Different : _htonl 4
C:\dmd\lib\WS2_32.LIB Offset 01AC5H Record Type 0088 
Error 1: Previous Definition Different : _htons 4
C:\dmd\lib\WS2_32.LIB Offset 01BB5H Record Type 0088 
Error 1: Previous Definition Different : _ntohl 4
C:\dmd\lib\WS2_32.LIB Offset 01BE5H Record Type 0088 
Error 1: Previous Definition Different : _ntohs 4
C:\dm\lib\snn.lib(_exit2)  Offset 00488H Record Type 00C3 
Error 1: Previous Definition Different : __exit
C:\dm\lib\snn.lib(stream)  Offset 3D014H Record Type 00C3 
Error 1: Previous Definition Different : ?WS  YAAAVistream  AAV1  Z (istream
&cdecl WS(istream &))
C:\dm\lib\snn.lib(_wfopen)  Offset 7898FH Record Type 00C3 
Error 1: Previous Definition Different : __WFOPEN
Settings\raf\My.lib
Warning 2: File Not Found Settings\raf\My.lib
Documents\d-projects\first\first.exe
Warning 2: File Not Found Documents\d-projects\first\first.exe
phobos.lib
Warning 2: File Not Found phobos.lib
stlp45dm_static.lib
Warning 2: File Not Found stlp45dm_static.lib
C:\dmd\lib\phobos.lib(com) 
Error 42: Symbol Undefined _IID_IUnknown
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegQueryValueExA 24
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegCloseKey 4
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegQueryInfoKeyA 48
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegCreateKeyExA 36
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegOpenKeyExA 20
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegOpenKeyA 12
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegDeleteKeyA 8
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegSetValueExA 24
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegDeleteValueA 8
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegFlushKey 4
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegEnumKeyExA 32
C:\dmd\lib\phobos.lib(registry) 
Error 42: Symbol Undefined _RegEnumValueA 32
C:\dm\lib\snn.lib(winstart) 
Error 42: Symbol Undefined _WinMain 16
C:\dm\lib\snn.lib(wconstar) 
Error 42: Symbol Undefined _wmain
C:\dm\lib\snn.lib(wwinstar) 
Error 42: Symbol Undefined _wWinMain 16
C:\dmd\lib\\Documents.res
Warning 2: File Not Found C:\dmd\lib\\Documents.res
C:\dm\lib\\Documents.res
Warning 2: File Not Found C:\dm\lib\\Documents.res
Process terminated with status 0 (0 minutes, 0 seconds)
35 errors, 0 warnings

Any ideas? I've checked the dmd.zip and dmc.zip archives are intact and they
check out OK. I've also tried playing around with what libraries to link to, but
that doesn't help. I'd quite like to get to use Code::Blocks, because though I
love vi, I'm currently using an IDE for project work (Eclipse), and I just know
my poor fingers will get confused if I keep switching between the two all the
time!

Have I just completely missed the how to deal with libraries in code::blocks
stuff or is it really obvious and I'm just being a clown? =)

Thanks in advance

Munch

PS It would be nice to use Eclipse for this, but I got a bit confused by all the
different alternative plugins recommended/disrecommended on the main D newsgroup
and the conflicting opinions about which ones were broken etc. If anybody has a
definite answer on this and a link to go to to d/l the plugin, that would be
great. Thanks!

PPS the successful build I get at the Cygwin command line looks very different
when it executes (see below) - the link command is completely different to the
one which Code::Blocks produces. I'm guessing this is something to do with the
reason Code::Blocks isn't working?

$ dmd first.d
c:\dmd\bin\..\..\dm\bin\link.exe first,,,user32+kernel32/noi;
Nov 21 2005
parent reply "John C" <johnch_atms hotmail.com> writes:
<Munchgreeble bigfoot.com> wrote in message 
news:dltpg9$ps9$1 digitaldaemon.com...
 Hi There,

 I've tried quite a few different ways of getting my first D program to 
 compile -
 I finally got it going on the command line (Cygwin), but Code::Blocks just
 doesn't want to play ball. I've tried looking on a couple of the different 
 FAQs
 around, but none of them seem to answer basic questions about common 
 compiler
 problems. I know I know, once I get this working I should go update the 
 wiki so
 that the next poor soul who comes along can have some assistance. I will 
 try to
 get around to that!

 OK, so I'm on WinXP. My two current ways of attempting a build are in
 Code::Blocks with the D modified binary (as indicated here:
 http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport#CodeBlocks) and also 
 from
 the commandline in Cygwin, using Vim (which now comes with D syntax 
 highlighting
 as standard - hoorah). I've got past a few errors (working out what needed 
 to be
 where for some of the hardcoded relative paths to work, complaints about
 corrupted libraries etc.) but I'm left with this in Code::Blocks and I'm 
 stuck:

 Project   : Console application
 Compiler  : Digital Mars D Compiler (called directly)
 Directory : C:\d-projects\first\
 --------------------------------------------------------------------------------
 Switching to target: default
 Compiling: first.d
 Linking console executable: C:\Documents and Settings\raf\My
 Documents\d-projects\first\first.exe
 link /nologo /delexe .objs\first.obj C:\dmd\lib\phobos.lib 
 C:\dmd\lib\WS2_32.LIB
 C:\dm\lib\snn.lib ,C:\Documents and Settings\raf\My
 Documents\d-projects\first\first.exe,,C:\dmd\lib\\ C:\dm\lib\\ ,
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
I can see a couple of problems, probably unrelated to your IDE. File names with spaces are known to give the linker problems - try using a relative path instead or a DOS-style path. You might also need to link in kernel32.lib, user32.lib and uuid.lib. Also, you don't have to link with phobos, as D does it automatically.
 C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB0EH Record Type 0091
 Error 1: Previous Definition Different : __init_10TypeInfo_D
 C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB28H Record Type 0091
 Error 1: Previous Definition Different : __Class_10TypeInfo_D
 C:\dmd\lib\phobos.lib(ti_delegate)  Offset 6DB41H Record Type 0091
 Error 1: Previous Definition Different : __vtbl_10TypeInfo_D
 C:\dmd\lib\phobos.lib(ti_creal)  Offset 6DFEBH Record Type 0091
 Error 1: Previous Definition Different : __init_10TypeInfo_c
 C:\dmd\lib\phobos.lib(ti_creal)  Offset 6E005H Record Type 0091
 Error 1: Previous Definition Different : __Class_10TypeInfo_c
 C:\dmd\lib\phobos.lib(ti_creal)  Offset 6E01EH Record Type 0091
 Error 1: Previous Definition Different : __vtbl_10TypeInfo_c
 C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB20H Record Type 0091
 Error 1: Previous Definition Different : __init_10TypeInfo_p
 C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB3AH Record Type 0091
 Error 1: Previous Definition Different : __Class_10TypeInfo_p
 C:\dmd\lib\phobos.lib(ti_idouble)  Offset 6FB53H Record Type 0091
 Error 1: Previous Definition Different : __vtbl_10TypeInfo_p
 C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 76457H Record Type 0091
 Error 1: Previous Definition Different : __init_11TypeInfo_Ac
 C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 76472H Record Type 0091
 Error 1: Previous Definition Different : __Class_11TypeInfo_Ac
 C:\dmd\lib\phobos.lib(ti_Acreal)  Offset 7648CH Record Type 0091
 Error 1: Previous Definition Different : __vtbl_11TypeInfo_Ac
 C:\dmd\lib\WS2_32.LIB Offset 01A95H Record Type 0088
 Error 1: Previous Definition Different : _htonl 4
 C:\dmd\lib\WS2_32.LIB Offset 01AC5H Record Type 0088
 Error 1: Previous Definition Different : _htons 4
 C:\dmd\lib\WS2_32.LIB Offset 01BB5H Record Type 0088
 Error 1: Previous Definition Different : _ntohl 4
 C:\dmd\lib\WS2_32.LIB Offset 01BE5H Record Type 0088
 Error 1: Previous Definition Different : _ntohs 4
 C:\dm\lib\snn.lib(_exit2)  Offset 00488H Record Type 00C3
 Error 1: Previous Definition Different : __exit
 C:\dm\lib\snn.lib(stream)  Offset 3D014H Record Type 00C3
 Error 1: Previous Definition Different : ?WS  YAAAVistream  AAV1  Z 
 (istream
 &cdecl WS(istream &))
 C:\dm\lib\snn.lib(_wfopen)  Offset 7898FH Record Type 00C3
 Error 1: Previous Definition Different : __WFOPEN
 Settings\raf\My.lib
 Warning 2: File Not Found Settings\raf\My.lib
 Documents\d-projects\first\first.exe
 Warning 2: File Not Found Documents\d-projects\first\first.exe
 phobos.lib
 Warning 2: File Not Found phobos.lib
 stlp45dm_static.lib
 Warning 2: File Not Found stlp45dm_static.lib
 C:\dmd\lib\phobos.lib(com)
 Error 42: Symbol Undefined _IID_IUnknown
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegQueryValueExA 24
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegCloseKey 4
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegQueryInfoKeyA 48
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegCreateKeyExA 36
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegOpenKeyExA 20
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegOpenKeyA 12
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegDeleteKeyA 8
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegSetValueExA 24
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegDeleteValueA 8
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegFlushKey 4
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegEnumKeyExA 32
 C:\dmd\lib\phobos.lib(registry)
 Error 42: Symbol Undefined _RegEnumValueA 32
 C:\dm\lib\snn.lib(winstart)
 Error 42: Symbol Undefined _WinMain 16
 C:\dm\lib\snn.lib(wconstar)
 Error 42: Symbol Undefined _wmain
 C:\dm\lib\snn.lib(wwinstar)
 Error 42: Symbol Undefined _wWinMain 16
 C:\dmd\lib\\Documents.res
 Warning 2: File Not Found C:\dmd\lib\\Documents.res
 C:\dm\lib\\Documents.res
 Warning 2: File Not Found C:\dm\lib\\Documents.res
 Process terminated with status 0 (0 minutes, 0 seconds)
 35 errors, 0 warnings

 Any ideas? I've checked the dmd.zip and dmc.zip archives are intact and 
 they
 check out OK. I've also tried playing around with what libraries to link 
 to, but
 that doesn't help. I'd quite like to get to use Code::Blocks, because 
 though I
 love vi, I'm currently using an IDE for project work (Eclipse), and I just 
 know
 my poor fingers will get confused if I keep switching between the two all 
 the
 time!

 Have I just completely missed the how to deal with libraries in 
 code::blocks
 stuff or is it really obvious and I'm just being a clown? =)

 Thanks in advance

 Munch

 PS It would be nice to use Eclipse for this, but I got a bit confused by 
 all the
 different alternative plugins recommended/disrecommended on the main D 
 newsgroup
 and the conflicting opinions about which ones were broken etc. If anybody 
 has a
 definite answer on this and a link to go to to d/l the plugin, that would 
 be
 great. Thanks!

 PPS the successful build I get at the Cygwin command line looks very 
 different
 when it executes (see below) - the link command is completely different to 
 the
 one which Code::Blocks produces. I'm guessing this is something to do with 
 the
 reason Code::Blocks isn't working?

 $ dmd first.d
 c:\dmd\bin\..\..\dm\bin\link.exe first,,,user32+kernel32/noi;

 
Nov 21 2005
parent reply Munchgreeble <Munchgreeble_member pathlink.com> writes:
In article <dltrp4$rim$1 digitaldaemon.com>, John C says...
<Munchgreeble bigfoot.com> wrote in message 
news:dltpg9$ps9$1 digitaldaemon.com...
 Switching to target: default
 Compiling: first.d
 Linking console executable: C:\Documents and Settings\raf\My
 Documents\d-projects\first\first.exe
 link /nologo /delexe .objs\first.obj C:\dmd\lib\phobos.lib 
 C:\dmd\lib\WS2_32.LIB
 C:\dm\lib\snn.lib ,C:\Documents and Settings\raf\My
 Documents\d-projects\first\first.exe,,C:\dmd\lib\\ C:\dm\lib\\ ,
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
I can see a couple of problems, probably unrelated to your IDE. File names with spaces are known to give the linker problems - try using a relative path instead or a DOS-style path. You might also need to link in kernel32.lib, user32.lib and uuid.lib. Also, you don't have to link with phobos, as D does it automatically.
OK, thanks. We're getting somewhere. Code::Blocks automatically pulled in those libraries (including phobos) - they weren't specified by me. Having now deleted the list of directories from which Code::Blocks automatically pulls libraries in, and added each of the libraries you suggested by hand, I am no longer getting complaints about things being redefined. However, I still have errors (see below). Surpirsingly these errors don't seem to be any different if I remove *all* the libraries! Thanks in advance for your help. Munch Project : hello Compiler : Digital Mars D Compiler (called directly) Directory : C:\d-projects\hello\ -------------------------------------------------------------------------------- Switching to target: default Compiling: first.d Linking executable: C:\d-projects\hello\hello.exe link /nologo /delexe /subsystem:windows .objs\first.obj C:\dm\lib\UUID.LIB C:\dm\lib\KERNEL32.LIB C:\dm\lib\USER32.LIB ,C:\d-projects\hello\hello.exe,,, OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved phobos.lib Warning 2: File Not Found phobos.lib objs\first.obj(first) Error 42: Symbol Undefined _main objs\first.obj(first) Error 42: Symbol Undefined __acrtused_con objs\first.obj(first) Error 42: Symbol Undefined __init_11TypeInfo_Aa objs\first.obj(first) Error 42: Symbol Undefined __nullext objs\first.obj(first) Error 42: Symbol Undefined __ModuleInfo_3std5stdio objs\first.obj(first) Error 42: Symbol Undefined __ModuleInfo_3std6string OPTLINK : Warning 134: No Start Address Process terminated with status 0 (0 minutes, 0 seconds) 6 errors, 0 warnings
Nov 22 2005
parent reply Carlos Santander <csantander619 gmail.com> writes:
Munchgreeble escribió:
 
 OK, thanks. We're getting somewhere. Code::Blocks automatically pulled in those
 libraries (including phobos) - they weren't specified by me. Having now deleted
 the list of directories from which Code::Blocks automatically pulls libraries
 in, and added each of the libraries you suggested by hand, I am no longer
 getting complaints about things being redefined. However, I still have errors
 (see below). Surpirsingly  these errors don't seem to be any different if I
 remove *all* the libraries!
 
 Thanks in advance for your help.
 
 Munch
 
 Project   : hello
 Compiler  : Digital Mars D Compiler (called directly)
 Directory : C:\d-projects\hello\
 --------------------------------------------------------------------------------
 Switching to target: default
 Compiling: first.d
 Linking executable: C:\d-projects\hello\hello.exe
 link /nologo /delexe /subsystem:windows .objs\first.obj C:\dm\lib\UUID.LIB
 C:\dm\lib\KERNEL32.LIB C:\dm\lib\USER32.LIB ,C:\d-projects\hello\hello.exe,,,
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 phobos.lib
 Warning 2: File Not Found phobos.lib
 objs\first.obj(first) 
 Error 42: Symbol Undefined _main
 objs\first.obj(first) 
 Error 42: Symbol Undefined __acrtused_con
 objs\first.obj(first) 
 Error 42: Symbol Undefined __init_11TypeInfo_Aa
 objs\first.obj(first) 
 Error 42: Symbol Undefined __nullext
 objs\first.obj(first) 
 Error 42: Symbol Undefined __ModuleInfo_3std5stdio
 objs\first.obj(first) 
 Error 42: Symbol Undefined __ModuleInfo_3std6string
 OPTLINK : Warning 134: No Start Address 
 Process terminated with status 0 (0 minutes, 0 seconds)
 6 errors, 0 warnings
 
 
 
Your problem is right in the first warning (I'd call it an error): phobos.lib can't be found by OPTLINK. Did you move/rename/delete it? Maybe you need to check your sc.ini to see if everything is ok. -- Carlos Santander Bernal
Nov 22 2005
parent reply Munchgreeble <Munchgreeble_member pathlink.com> writes:
In article <dm0msc$fv2$2 digitaldaemon.com>, Carlos Santander says...
Your problem is right in the first warning (I'd call it an error): phobos.lib 
can't be found by OPTLINK. Did you move/rename/delete it? Maybe you need to 
check your sc.ini to see if everything is ok.
Brilliant - thanks =) We're getting ever closer. There is no problem with the phobos lib or sc.ini - the build works fine from the command line, it's just from within Code::Blocks that I have the problem. I guess it's something to do with the way it calls the compiler? Anyway, I've now put the dmd/lib back into the Code::Blocks link path, and it's not complaining about not being able to see phobos.lib any more. We now have just three errors: Project : Compiler : Digital Mars D Compiler (called directly) Directory : C:\d-projects\hello\ -------------------------------------------------------------------------------- Switching to target: default Compiling: first.d Linking executable: C:\d-projects\hello\hello.exe link /nologo /delexe /subsystem:windows .objs\first.obj ,C:\d-projects\hello\hello.exe,,..\..\dmd\lib\ , OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved .\..\dmd\lib\phobos.lib(ti_double) Offset 19FC5H Record Type 0091 Error 1: Previous Definition Different : __init_10TypeInfo_d .\..\dmd\lib\phobos.lib(ti_double) Offset 19FDFH Record Type 0091 Error 1: Previous Definition Different : __Class_10TypeInfo_d .\..\dmd\lib\phobos.lib(ti_double) Offset 19FF8H Record Type 0091 Error 1: Previous Definition Different : __vtbl_10TypeInfo_d Process terminated with status 0 (0 minutes, 0 seconds) 3 errors, 0 warnings Since it's complaining about inconsistencies, I can't help wondering if this version of Code::Blocks, which was released some time ago now, is having some incompatibility problems with the latest compiler/library. That would be a shame cause I guess it would mean this is the end of the road. If anybody has any suggestions please shout! Thanks Munch
Nov 23 2005
next sibling parent Carlos Santander <csantander619 gmail.com> writes:
Munchgreeble escribió:
 
 Brilliant - thanks =) We're getting ever closer. There is no problem with the
 phobos lib or sc.ini - the build works fine from the command line, it's just
 from within Code::Blocks that I have the problem. I guess it's something to do
 with the way it calls the compiler? Anyway, I've now put the dmd/lib back into
 the Code::Blocks link path, and it's not complaining about not being able to
see
 phobos.lib any more. We now have just three errors:
 
 Project   : 
 Compiler  : Digital Mars D Compiler (called directly)
 Directory : C:\d-projects\hello\
 --------------------------------------------------------------------------------
 Switching to target: default
 Compiling: first.d
 Linking executable: C:\d-projects\hello\hello.exe
 link /nologo /delexe /subsystem:windows .objs\first.obj
 ,C:\d-projects\hello\hello.exe,,..\..\dmd\lib\ ,
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
 
 ..\..\dmd\lib\phobos.lib(ti_double)  Offset 19FC5H Record Type 0091 
 Error 1: Previous Definition Different : __init_10TypeInfo_d
 ..\..\dmd\lib\phobos.lib(ti_double)  Offset 19FDFH Record Type 0091 
 Error 1: Previous Definition Different : __Class_10TypeInfo_d
 ..\..\dmd\lib\phobos.lib(ti_double)  Offset 19FF8H Record Type 0091 
 Error 1: Previous Definition Different : __vtbl_10TypeInfo_d
 Process terminated with status 0 (0 minutes, 0 seconds)
 3 errors, 0 warnings
 
 Since it's complaining about inconsistencies, I can't help wondering if this
 version of Code::Blocks, which was released some time ago now, is having some
 incompatibility problems with the latest compiler/library. That would be a
shame
 cause I guess it would mean this is the end of the road. If anybody has any
 suggestions please shout!
 
 Thanks
 
 Munch
 
 
Gee, now I don't know. I truly have no idea, sorry. -- Carlos Santander Bernal
Nov 23 2005
prev sibling parent reply John Reimer <terminal.node gmail.com> writes:
Munchgreeble wrote:
 In article <dm0msc$fv2$2 digitaldaemon.com>, Carlos Santander says...
 
Your problem is right in the first warning (I'd call it an error): phobos.lib 
can't be found by OPTLINK. Did you move/rename/delete it? Maybe you need to 
check your sc.ini to see if everything is ok.
Brilliant - thanks =) We're getting ever closer. There is no problem with the phobos lib or sc.ini - the build works fine from the command line, it's just from within Code::Blocks that I have the problem. I guess it's something to do with the way it calls the compiler? Anyway, I've now put the dmd/lib back into the Code::Blocks link path, and it's not complaining about not being able to see phobos.lib any more. We now have just three errors: Project : Compiler : Digital Mars D Compiler (called directly) Directory : C:\d-projects\hello\ -------------------------------------------------------------------------------- Switching to target: default Compiling: first.d Linking executable: C:\d-projects\hello\hello.exe link /nologo /delexe /subsystem:windows .objs\first.obj ,C:\d-projects\hello\hello.exe,,..\..\dmd\lib\ , OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved .\..\dmd\lib\phobos.lib(ti_double) Offset 19FC5H Record Type 0091 Error 1: Previous Definition Different : __init_10TypeInfo_d .\..\dmd\lib\phobos.lib(ti_double) Offset 19FDFH Record Type 0091 Error 1: Previous Definition Different : __Class_10TypeInfo_d .\..\dmd\lib\phobos.lib(ti_double) Offset 19FF8H Record Type 0091 Error 1: Previous Definition Different : __vtbl_10TypeInfo_d Process terminated with status 0 (0 minutes, 0 seconds) 3 errors, 0 warnings Since it's complaining about inconsistencies, I can't help wondering if this version of Code::Blocks, which was released some time ago now, is having some incompatibility problems with the latest compiler/library. That would be a shame cause I guess it would mean this is the end of the road. If anybody has any suggestions please shout! Thanks Munch
Is phobos.lib being linked in twice? I can't make out what the link command line is doing. Nor does it show how dmd was called. What are the dmd command line arguments? -JJR
Nov 23 2005
next sibling parent Munchgreeble <"a" b.com \"munchgreeble xATx bigfoot xDOTx com\"> writes:
I don't know how Code::Blocks calls the compiler I'm afraid - it's not 
configurable. I think I'm going to give up on Code::Blocks now.
I've been getting on fine with Vim/Cygwin anyway, just get my
editor commands mixed up sometimes. I guess I'll perhaps investigate
the Eclipse plugins.

Thanks for you help though everybody =)

Cheers

Munch
 
 Is phobos.lib being linked in twice?  I can't make out what the link 
 command line is doing. Nor does it show how dmd was called.  What are 
 the dmd command line arguments?
 
 -JJR
Nov 24 2005
prev sibling parent Georg Wrede <georg.wrede nospam.org> writes:
John Reimer wrote:
 Is phobos.lib being linked in twice?  I can't make out what the link 
 command line is doing. Nor does it show how dmd was called.  What are 
 the dmd command line arguments?
Yesterday I made a nice way to snoop at the linker parameters: Create a (on Windows) "link.bat", or (on Linux) "ld" (a shell script), that just prints out the parameters it got. Change your PATH so that the directory where this fake linker is, is first in PATH. Or why not create the fake linker with D and have it print the parameters in an even nicer format! :-) (Or for the _real_ lazy, copy hello.d from samples/d/, compile it and then rename it to "link.exe" or "ld".) I had it write the results in a file. ("/tmp/ld.out")
Nov 24 2005