September 10, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On 2013-09-10 11:04, Anton Alexeev wrote: > Can be but not libphobos2 Link statically with it, which is does by default. Just compile with: dmd -L-lcurl test.d -- /Jacob Carlborg |
September 11, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Tuesday, 10 September 2013 at 11:06:04 UTC, Jacob Carlborg wrote: > On 2013-09-10 11:04, Anton Alexeev wrote: > >> Can be but not libphobos2 > > Link statically with it, which is does by default. Just compile with: > > dmd -L-lcurl test.d The point is: http://pastebin.com/0VkYgFix |
September 12, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On 9/12/2013 6:20 AM, Anton Alexeev wrote:
> On Tuesday, 10 September 2013 at 11:06:04 UTC, Jacob Carlborg wrote:
>> On 2013-09-10 11:04, Anton Alexeev wrote:
>>
>>> Can be but not libphobos2
>>
>> Link statically with it, which is does by default. Just compile with:
>>
>> dmd -L-lcurl test.d
>
> The point is:
> http://pastebin.com/0VkYgFix
Apparently you need to install the libcurl dev package. The linker can't find libcurl.a.
|
September 12, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Thursday, 12 September 2013 at 01:16:28 UTC, Mike Parker wrote:
> On 9/12/2013 6:20 AM, Anton Alexeev wrote:
>> On Tuesday, 10 September 2013 at 11:06:04 UTC, Jacob Carlborg wrote:
>>> On 2013-09-10 11:04, Anton Alexeev wrote:
>>>
>>>> Can be but not libphobos2
>>>
>>> Link statically with it, which is does by default. Just compile with:
>>>
>>> dmd -L-lcurl test.d
>>
>> The point is:
>> http://pastebin.com/0VkYgFix
>
> Apparently you need to install the libcurl dev package. The linker can't find libcurl.a.
I've installed libcurl4-openssl-dev 7.29.0-1ubuntu3.1 before I asked for help here. Else I can't even compile with that command: dmd -L-lphobos2 -L-lcurl test.d
|
September 12, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On 2013-09-12 12:14, Anton Alexeev wrote: > I've installed libcurl4-openssl-dev 7.29.0-1ubuntu3.1 before I asked for > help here. Else I can't even compile with that command: dmd -L-lphobos2 > -L-lcurl test.d How does your dmd.conf file look like? -- /Jacob Carlborg |
September 12, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Thursday, 12 September 2013 at 11:30:05 UTC, Jacob Carlborg wrote: > On 2013-09-12 12:14, Anton Alexeev wrote: > >> I've installed libcurl4-openssl-dev 7.29.0-1ubuntu3.1 before I asked for >> help here. Else I can't even compile with that command: dmd -L-lphobos2 >> -L-lcurl test.d > > How does your dmd.conf file look like? ; ; dmd.conf file for dmd ; ; dmd will look for dmd.conf in the following sequence of directories: ; - current working directory ; - directory specified by the HOME environment variable ; - directory dmd resides in ; - /etc directory ; ; Names enclosed by %% are searched for in the existing environment and inserted ; ; The special name %@P% is replaced with the path to this file ; [Environment] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu -L-L/usr/lib/x86_64-linux-gnu -L--no-warn-search-mismatch -L--export-dynamic |
September 12, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On 2013-09-12 18:25, Anton Alexeev wrote: > [Environment] > > DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import > -L-L/usr/lib/i386-linux-gnu -L-L/usr/lib/x86_64-linux-gnu > -L--no-warn-search-mismatch -L--export-dynamic I don't see way explicitly linking with Phobos would make a difference, since the compiler will link with Phobos implicitly. That assumes you have libphobos2.a in /usr/lib/i386-linux-gnu or /usr/lib/x86_64-linux-gnu. -- /Jacob Carlborg |
September 13, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | So, nobody can give an easy answer how to statically link the libraries with the executable and I have yo use Bin2D? |
September 13, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On Friday, 13 September 2013 at 19:54:41 UTC, Anton Alexeev wrote:
> So, nobody can give an easy answer how to statically link the libraries with the executable and I have yo use Bin2D?
Did you try to use -static option of compiler? It forces to link application with static libraries instead of shared.
|
September 14, 2013 Re: Adding libraries to an executable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Anton Alexeev | On Friday, September 13, 2013 21:54:39 Anton Alexeev wrote:
> So, nobody can give an easy answer how to statically link the libraries with the executable and I have yo use Bin2D?
If you give the exact file name for the static library (e.g. /path/to/libcurl.a), then it should link against the static version of the library. Also, -L-static might help, as it tells the linker to only link static libraries.
- Jonathan M Davis
|
Copyright © 1999-2021 by the D Language Foundation