link a static library lazarus / 1-Linux ---------------------------------------------------------------------- angman · 2006-10-16 09:17 I want to build a lazarus console program that use a static thirty part library of wich only the static version exixts for linux. I added the {$linklib dscud5} to my source program and then added the path in the compiler option library path. Why when I build the project get the error: /usr/bin/ld: cannot find -ldscud5. Maybe I' m wronging something, but not understand wath: May you help me. Thanks Angman  :shock: ---------------------------------------------------------------------- matthijs · 2006-10-16 14:51 This is an error from the linker. Make sure dscud5 library is in the search path of ld. ---------------------------------------------------------------------- angman · 2006-10-17 08:27 Yes it is and show otions in compiler options is: -S2cgi -OG1 -gl -vewnhi -l -Fllib/gcc3/dscud5/ -Fu. the directory contains the library libdscud5.a and in my source I added the directive {$linklib dscud5} Is it correct or there is something that I am wronging? Thanks,  Angman :?: ---------------------------------------------------------------------- RudieD · 2006-10-17 09:00 There has been a previous post in connection with .a files and as far as I can remember, theire not supported by freepascal (yet). ---------------------------------------------------------------------- angman · 2006-10-17 09:13 I believe the opposite, there are many notices in freepascal manuals that tells how to link aganinst a static .a library. I already tried to link a console freepascal program with the same static library, and not considearging other problem emerged, it at least find the library. bye,  angman ---------------------------------------------------------------------- felipemdc · 2006-10-17 10:45 Yes, I also read that .a libraries are supported. Maybe it´s better if you ask this on the Free Pascal mailling list. There you will find better answers. This forum is more dedicated to the Lazarus IDE and the Lazarus Component Library, not compiler issues. ---------------------------------------------------------------------- angman · 2006-10-17 11:39 I know this, but my question is why lazarus does not find the library ?? while freepascal does. Thanks, angman ---------------------------------------------------------------------- felipemdc · 2006-10-17 11:44 Quote from: "angman"I know this, but my question is why lazarus does not find the library ?? while freepascal does. What command do you use to compile your program on the command-line? Is this different from the command Lazarus is using? Lazarus simply calls FreePascal to do the compilation job, so it's just a question of setting the right compiler options. ---------------------------------------------------------------------- angman · 2006-10-17 12:59 I dont use a command, I compile directli within the ide. and show otions in compiler options is: -S2cgi -OG1 -gl -vewnhi -l -Fllib/gcc3/dscud5/ -Fu. The lib/gcc3/dscud5 path is relative to the project directory. It is all rright, or there is something wrong? angman ---------------------------------------------------------------------- angman · 2006-10-17 16:51 excuse me, I dah'nt understood your thinking. The commad taht I use to compile in freepascal is: fpc -Fllib/gcc3/msduc5 prConsLaz.lpr. Thanks very much, Angman ---------------------------------------------------------------------- felipemdc · 2006-10-17 18:41 Open your project on Lazarus, go to the Menu Project --> Compiler Options Open the Tab "Others". And put -Fllib/gcc3/msduc5 on the custom options field. Does it work? ---------------------------------------------------------------------- angman · 2006-10-18 13:55 I am a newby with lazarus, and maybe the problem couls be an other. I saw that the menu command build project in linux does'nt work, so I am executing the menu command build file.  Could the problem is inerent to this? angman :?: ---------------------------------------------------------------------- felipemdc · 2006-10-18 14:23 Quote from: "angman"I saw that the menu command build project in linux does'nt work, What do you mean by "doesn´t work"? Does it give an error message? If so, what is the message? If not, what did you expect to see that you did not? Did you test the solution I passed to you on my other post? Did it work? ---------------------------------------------------------------------- angman · 2006-10-18 15:48 I mean that The ide does not any eror, but not generate any executable, without give any link error. But if I do the command build file, I get then link error  cannot find -ldscud5 I also tried under windows, in wich the command build project work, but also get then link error. In both I setted the options as you suggest. angman ---------------------------------------------------------------------- felipemdc · 2006-10-18 19:12 Ok, you really should ask this to the compiler experts on the Free Pascal mailling list =) ---------------------------------------------------------------------- angman · 2006-10-19 08:03 Ok I will do so, thanks for the help sekel. angman ---------------------------------------------------------------------- angman · 2006-10-20 08:49 I am glad to say thal I all problem had, has solved. Thanks very much for the help. angman ---------------------------------------------------------------------- felipemdc · 2006-10-20 11:08 How was it solved? thanks, ---------------------------------------------------------------------- angman · 2006-10-20 13:14 for compiling problems, solved starting a new project and then copyng the code from the old file. (maybe I did some wrong action in the old) for linking problem, searching in internet after some steps I found taht the libraries to include was stdc++ and rt. angman