[RESOLVED] compile to .dll
Hello,
I am a beginner in the coding area, and I started with a very similar language as C+ (called Pawn)..
There is one issue in the game, which has to be fixed with a code (y axis of the mouse moves faster than the x axis with newer mouses)
So someone gave me the code to fix this, with a .dll file. But he only gave me the .cpp file and I have no clue how to compile it to a .dll file.
The code when I open it with the editor is:
https://pastebin.com/aXUv9VrC
It would be very kind if someone could just quickly compile this to a .dll file and upload it somewhere, that I can download it :/
Regards
Re: [RESOLVED] compile to .dll
Re: [RESOLVED] compile to .dll
@mikado:
Next time you find yourself in the situation like this just don't mess with Visual Studio project.
- Put your .cpp file say to C:\Temp\1\mydllcode.cpp (same to .h files if any)
- Run Visual Studio Command Prompt of the required bitness (or whatever your VS provides)
- Change directory to C:\Temp\1
- ...and finally run the command below
Code:
cl.exe mydllcode.cpp /MD /link /dll /out:mydll.dll
In case the dll make use of C++ STL the command line is modified a bit:
Code:
cl.exe mydllcode.cpp /MD /EHsc /link /dll /out:mydll.dll
In case the dll is to contain some resources, the command lines are:
Code:
rc.exe mydllres.rc
cl.exe mydllcode.cpp /MD /link /dll /out:mydll.dll mydllres.res
In case you are to debug the dll:
Code:
cl.exe mydllcode.cpp /MDd /Zi /link /dll /out:mydll.dll
That's it. This looks kinda old school, but it will definitely save you some time. And let you understand what goes under the VS hood. :)