Discussions related to Visual Prolog
sbishop61
Posts: 12
Joined: 9 May 2021 9:55

IDE/Linker changing path

Unread post by sbishop61 »

I am trying to use a foreign DLL (rust in this case)
I add the .lib file to the project.
File Name: callrust\rustdll.dll.lib

Name: rustdll.dll.lib
Path: D:\VIP\rust_Direst\callrust\
When I build, the IDE seems to change the path by adding 64 to the subdirectory.
fatal error lnk2506 : : Cannot open file 'd:\vip\rust_direst\callrust64\rustdll.dll.lib', errno=2 (No such file or directory). LastError:3
Have I missed something? How should I specify the .lib for the DLL to link against?
User avatar
Thomas Linder Puls
VIP Member
Posts: 1294
Joined: 28 Feb 2000 0:01

Re: IDE/Linker changing path

Unread post by Thomas Linder Puls »

The <something>64 is used by convention for the 64 bit version of a project.

It makes it possible to have 32 bit libs in <something> and 64 bit libs in <something>64.

Similarly the resulting program will end up in <exe> and <exe>64.

And finally the DLLs can also be placed in <dll> and <dll>64 and added to the project (and will then be copied to <exe> and <exe>64 respectively).

So the question is whether your DLL is actually for 32 bit or 64 bit?

If it is for 64 bit then you should (could) copy it to some <something>64 folder and add a non-existing DLL in the <something> folder to the project (I think you may temporarily have to have a fake DLL in the folder while adding the DLL to the project).

If on the other hand your DLL is for 32 bit then you should change your vip project to create a 32 bit target program.

Hope you get it :-)?
Regards Thomas Linder Puls
PDC
sbishop61
Posts: 12
Joined: 9 May 2021 9:55

Re: IDE/Linker changing path

Unread post by sbishop61 »

Thank you Thomas.
My project is x64. I think I get it - apart fom the <dll> example you gave, which looks the best solution for me. Please would you clarify the decalarion in the code and awhere/how the <dll> directory or the .lib file is added to the project.
Post Reply