win32 api & lib issue
Imperatorn
johan_forsberg_86 at hotmail.com
Thu Nov 2 10:58:51 UTC 2023
On Thursday, 2 November 2023 at 10:17:37 UTC, Peter Hu wrote:
> On Thursday, 2 November 2023 at 10:02:29 UTC, Imperatorn wrote:
>> On Thursday, 2 November 2023 at 09:58:21 UTC, Peter Hu wrote:
>>> On Thursday, 2 November 2023 at 09:13:11 UTC, Imperatorn
>>> wrote:
>>>> On Thursday, 2 November 2023 at 09:08:02 UTC, Imperatorn
>>>> wrote:
>>>>> [...]
>>>>
>>>> Another alternative if you're using dub is to add this in
>>>> your dub.json instead:
>>>>
>>>> ```json
>>>> "libs": ["user32", "comdlg32"]
>>>> ```
>>>>
>>>> This seems be something related to DMD vs LDC. Because if I
>>>> change the compiler to DMD I also get unresolved external
>>>> symbols, but not with LDC.
>>>>
>>>> It seems the forwarding of directives from submodules are
>>>> different.
>>> Thank you.
>>>
>>> Below two pragma solved the isse but am confused as they are
>>> already in the system path.This is the first time I have to
>>> include lib files here.How come other gui programs don't have
>>> to do this.
>>> pragma(lib,"user32");
>>> pragma(lib,"comdlg32");
>>
>> I'm not sure why, it works for me, but I think it could be
>> something dmd does different. The pragma lib is inserted into
>> the generated object file, or otherwise passed to the linker,
>> so the linker automatically links in that library.
>>
>> I'm guessing dmd for some reason does not see it in the
>> submodule, but I have no proof that's the issue, I'm just
>> guessing.
>
> Really appreciated for the help.I am learning to understand.
> Not using these two pragma in the source,other in the
> commandline:dmd -m64 user32.lib comdlg32.lib test.d
> compiled.But---
> In an IDE say PoseidonD it still failed to compile even if I
> provided the library path to the compiler,I just can't
> understand how come my other small programs ( based on gui
> libslike DFL2,iup4D,dwt,NAppGui4D ) works fine without having
> to provide pragma in the source before compiling.
I'm sorry, I don't know. I have just observed that when using LDC
the libraries gets forwarded from submodules but not with DMD.
So what I usually do is to add them in my dub.json "libs"
property as shown before.
Oh my, I didn't know poseidon still existed :D
Is this what you're using?
https://bitbucket.org/KuanHsu/poseidond
I currently use vscode and Visual D, they both work good.
But it's always fun to see other IDEs
More information about the Digitalmars-d-learn
mailing list