digitalmars.D.learn - FreeBSD linking problem
- s4mmael (14/14) Aug 11 2011 Hi folks,
- Adam D. Ruppe (4/4) Aug 11 2011 Find your dmd.conf. It's usually in the same folder as the dmd binary.
- Jacob Carlborg (6/20) Aug 11 2011 Just remove the flag "--no-warn-search-mismatch" from the dmd.conf file....
- s4mmael (10/10) Aug 11 2011 Dr. Adam Ruppe and Jacob Carlborg,
- Jacob Carlborg (10/20) Aug 11 2011 Seems it cannot find libphobos2.a in any of the specified search paths.
- s4mmael (7/7) Aug 12 2011 I added /usr/local/lib to my config:
- Jacob Carlborg (4/11) Aug 12 2011 No problem.
Hi folks, During linking a very simple "hello world" program with "dmd2 -run hello.d" I got the following errors: /usr/bin/ld: unrecognized option '--no-warn-search-mismatch' /usr/bin/ld: use the --help option for usage information I was trying this on two different machines, one of them is clear just installed FreeBSD. Results is the same. OS: FreeBSD 8.2 Release DMD: both 2.053 and 2.054 LD: GNU ld version 2.15 [FreeBSD] 2004-05-23 How do I overcome this error? It's quite clear dmd2 is trying to link an object file with an incorrect for this ld version options, but how to fix that? Google did not help. Thank you in advance for any help. It's greatly appreciated.
Aug 11 2011
Find your dmd.conf. It's usually in the same folder as the dmd binary. In there there's a line like: lib32 -L-L% P%/../lib64 -L--no-warn-search-mismatch -L--export-dynamic -L-lrt just delete the -L--no-warn-search-mismatch from there.
Aug 11 2011
On 2011-08-11 15:48, s4mmael wrote:Hi folks, During linking a very simple "hello world" program with "dmd2 -run hello.d" I got the following errors: /usr/bin/ld: unrecognized option '--no-warn-search-mismatch' /usr/bin/ld: use the --help option for usage information I was trying this on two different machines, one of them is clear just installed FreeBSD. Results is the same. OS: FreeBSD 8.2 Release DMD: both 2.053 and 2.054 LD: GNU ld version 2.15 [FreeBSD] 2004-05-23 How do I overcome this error? It's quite clear dmd2 is trying to link an object file with an incorrect for this ld version options, but how to fix that? Google did not help. Thank you in advance for any help. It's greatly appreciated.Just remove the flag "--no-warn-search-mismatch" from the dmd.conf file. I think that flag lets you specify both 32 and 64bit libraries and it will not warn when it finds the wrong architecture. -- /Jacob Carlborg
Aug 11 2011
Dr. Adam Ruppe and Jacob Carlborg, Thank you very much for your help! An error now is as follows: /usr/bin/ld: cannot find -lphobos2 --- errorlevel 1 [Environment] DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L% P%/../lib64 -L--export-dynamic -L-lrt
Aug 11 2011
On 2011-08-11 16:10, s4mmael wrote:Dr. Adam Ruppe and Jacob Carlborg, Thank you very much for your help! An error now is as follows: /usr/bin/ld: cannot find -lphobos2 --- errorlevel 1 [Environment] DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L% P%/../lib64 -L--export-dynamic -L-lrtSeems it cannot find libphobos2.a in any of the specified search paths. The specified search paths are: /usr/local/lib32 % P%/../lib64 Where % P% is relative to the binary. Also all the search paths for all the regular C libraries: /usr/lib, /usr/local/lib and so on, don't know the exact search paths on FreeBSD. -- /Jacob Carlborg
Aug 11 2011
I added /usr/local/lib to my config: [Environment] DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L/usr/local/lib -L-L% P%/../lib64 -L--export-dynamic -L-lrt Now it's OK. Your help was very useful, thank you!
Aug 12 2011
On 2011-08-12 09:16, s4mmael wrote:I added /usr/local/lib to my config: [Environment] DFLAGS=-I/usr/local/include/d/phobos2 -I/usr/local/include/d/druntime/import -L-L/usr/local/lib32 -L-L/usr/local/lib -L-L% P%/../lib64 -L--export-dynamic -L-lrt Now it's OK. Your help was very useful, thank you!No problem. -- /Jacob Carlborg
Aug 12 2011