User forums > General (but related to Code::Blocks)
Building Dynamic Library
sodev:
I know where MY paths are coming from, thanks, but i dont know where HIS paths are coming from ;). I am using the macros and they expand to the proper location for me. I guessed he hardcoded the paths to wrong values, because he is already using a very strange compiler setup with relative paths to compiler internal directories as you can see from the build log (and i remember him from another thread where he displayed his strange compiler setup).
And yes, you have to use the mt.exe from the SDK that you are linking against, and no, the manifest should get created automatically, at least thats what MSDN says. However it doesnt hurt to specify /MANIFEST explicit in the linker options to enable it. And the default name for it is indeed <full name with extension>.manifest, most important use of the manifest is to enable proper UI dlls or your application looks like Windows 3.1.
BlueHazzard:
@sodev: sorry, i thought your response was from lbertolotti ::) I think you know more from this, i have no idea from the visual studio compiler so i am out :)
cacb:
--- Quote from: lbertolotti on July 30, 2017, 07:31:07 pm ---Running target post-build steps
mt.exe /nologo /manifest "bin\Release\example_mic_dyn.dll.manifest" /outputresource:"bin\Release\example_mic_dyn.dll";2
Execution of 'mt.exe /nologo /manifest "bin\Release\example_mic_dyn.dll.manifest" /outputresource:"bin\Release\example_mic_dyn.dll";2' in 'C:\Users\lucao\Desktop\example_mic_dyn' failed.
--- End quote ---
I think manifest files are only "useful" if you use GUI in the DLL, perhaps you do.
For targets with GUI and MSVC compiler I use the following in the Code::Blocks post build step
--- Code: ---mt.exe /nologo /manifest $(TARGET_OUTPUT_FILE).manifest /outputresource:$(TARGET_OUTPUT_FILE);1
--- End code ---
Essentially linking the manifest data into the executable. The effect is that the Windows GUI uses the current theme etc.
In my case with MSVC2013 I find mt.exe in C:\Program Files (x86)\Windows Kits\8.1\bin\x64 so it must be in the path
lbertolotti:
Setting /MANIFEST in linker settings solved the problem:
Code::Blocks build log:
--- Code: ----------------- Clean: Release in example_mic_dyn (compiler: Microsoft VC 2017)---------------
Cleaned "example_mic_dyn - Release"
-------------- Build: Release in example_mic_dyn (compiler: Microsoft VC 2017)---------------
cl.exe /nologo /MD /Ox /W3 /DBUILD_DLL /DNDEBUG /I"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" /I"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64" /I"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86" /I"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\arm64" /I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt" /I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\atlmfc\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /I"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\lib\x64" /I"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x64" /I"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64" /I"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\arm64" /I"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64" /c main.cpp /Foobj\Release\main.obj
main.cpp
link.exe /dll /nologo /LIBPATH:"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um" /LIBPATH:"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64" /LIBPATH:"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x86" /LIBPATH:"..\..\..\..\..\..\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\arm64" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\include" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\atlmfc\include" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.10.25017\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\arm64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64" /out:bin\Release\example_mic_dyn.dll user32.lib obj\Release\main.obj /INCREMENTAL:NO /MANIFEST
Creating library bin\Release\example_mic_dyn.lib and object bin\Release\example_mic_dyn.exp
Output file is bin\Release\example_mic_dyn.dll with size 8.50 KB
Running target post-build steps
mt.exe /nologo /manifest "bin\Release\example_mic_dyn.dll.manifest" /outputresource:"bin\Release\example_mic_dyn.dll";2
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))
--- End code ---
Windows cmd:
--- Code: ---C:\Users\lucao\Desktop\example_mic_dyn>PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.15063.0\x64
C:\Users\lucao\Desktop\example_mic_dyn>mt.exe /nologo /manifest "bin\Release\example_mic_dyn.dll.manifest" /outputresource:"bin\Release\example_mic_dyn.dll";2
--- End code ---
https://msdn.microsoft.com/en-us/library/windows/desktop/aa375365(v=vs.85).aspx
example_mic_dyn.dll.manifest:
--- Code: ---<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version