vs15 profiling shows only app name - visual-studio

I'm new in visual studio, and use before only codeblocks with gcc-mingw.
The problem is: when i try to profile my application, i want to see list of functions but i get application name instead :
screenshot
how fix it ?
linker command line :
/OUT:"{projects}\bin_vs14\Debug\NovaEngine.exe" /MANIFEST /PROFILE /NXCOMPAT /PDB:"{projects}\bin_vs14\Debug\NovaEngine.pdb" /DYNAMICBASE {manylibs} /MACHINE:X86 /INCREMENTAL:NO /PGD:"{projects}\bin_vs14\Debug\NovaEngine.pgd" /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"{projects}\bin_vs14\obj\Debug\NovaEngine.exe.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1

Module names are shown instead of function names if symbols cannot be resolved e.g. due to missing or out-of-date pdbs. Please ensure that you have up-to-date pdbs e.g. by running your app under debugger.
Also from your screenshot I suppose you have VS 2015 RTM, but not Update 1. Please try to upgrade to VS 2015 Update 1. It has a number of fixes in profiler related to symbol resolution.

Related

Visual Studio 2022: error MSB3721: The command "ml.exe ... " exited with code 1

I am using Microsoft Visual Studio Community 2022 (ARM 64-bit) Version 17.3.0 Preview 6.0 to build a Win32 (Intel x86 32-bit) application. I get the following error:
1>C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Microsoft\VC\v170\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml.exe /c /nologo /Sg /Zi /Fo"Debug\byteasm.obj" /D"_DEBUG" /Fl"Debug\byteasm.lst" /W3 /errorReport:prompt /TaC:\Users\James\Documents\Dolphin\Core\DolphinVM\VMLib..\byteasm.asm" exited with code 1.
But when I open a command prompt I can successfully execute the following:
"C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31629\bin\Hostx86\x86\ml.exe" /c /nologo /Sg /Zi /Fo"Debug\byteasm.obj" /D"_DEBUG" /Fl"Debug\byteasm.lst" /W3 /errorReport:prompt /TaC:\Users\James\Documents\Dolphin\Core\DolphinVM\VMLib..\byteasm.asm
Assembling: C:\Users\James\Documents\Dolphin\Core\DolphinVM\VMLib..\byteasm.asm
Since I can execute the same thing (?) from the command line I don't understand why VisualStudio is reporting an error. Any advice? Once I've done the assembly manually, can I tell VisualStudio to skip it?
The suggestion from #njuffa to increase the verbosity of the build was helpful and showed the error that it could not find ml.exe. I believe this is a bug in Version 17.3.0 Preview 6.0 since it is able to find the C++ compiler for x86. My workaround was to add the x86 tools directory to the path (which would break attempts to build for any other environment). Thanks to all for the helpful responses and advice!

Can not build assembly code in visual studio

For some reason, I have to use some assembly code in my dll library project. My visual studio version is 2019.
I follow the settings as below to build assembly code
Project -> Build customizations, check masm
In the property of my assembly code file, set Item Type to Microsoft Macro Assembler
Then I build the project and got the following error.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\masm.targets(70,5): error MSB3721: The command "ml64.exe /c /nologo /Zi /Fo"x64\Debug\my_assembly.obj" /W3 /errorReport:prompt /Tamy_assembly.asm" exited with code 1.
But if I go to my project directory and run ml64.exe with options in error message above, I can successfully build the assembly code.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64\ml64.exe" /c /nologo /Zi /Fo"x64\Debug\my_assembly.obj" /W3 /errorReport:prompt /Tamy_assembly.asm
Assembling: my_assembly.asm
After the manual build of my_assembly.obj from commandline, the build also succeed in visual studio IDE.
What's wrong with the ml64.exe invoked from visual studio IDE?

Unable to replicate Visual Studio Build

We have a Visual Studio 2015 driver project. For various reasons, we use "make" (the unix tool, built for windows) to build our entire product. It is also preferred to use make to build the windows-only components (keeps the build process consistent).
Running Server 2012R2, VS 2015 Update 3, DDK 10 and SDK 10.
The project builds fine in VS2015 and the driver works, so, the codebase is good.
I enabled the verbose build output and captured that to analyze what VS is doing to build the project (the driver is simply a bunch of C files, does not appear to be anything too earth-shatteringly unique). The VS build sets LIB, LIBPATH and INCLUDE variables, then issues a "cl.exe" command to build, followed by a "link.exe" command to link. There are also commands to build the message file (mc.exe) and resource file "rc.exe". I captured all of these commands and incorporated them into a makefile.
I can get the project to compile but, my problem is with the link phase. I will show the error in a few lines. I have tried simply running the commands (from the log) by themselves in a "VS2015 x64 Native Tools Command Prompt" (%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64) and I get the same error.
When I link, I get:
LINK : error LNK2001: unresolved external symbol GsDriverEntry
os_win.obj : error LNK2001: unresolved external symbol __stdio_common_vsprintf
winbuild\x64\Win7Release\driver.sys : fatal error LNK1120: 2 unresolved externals
I had to make one change from the cl.exe command line that VS logged, which was to specify /GS- (VS enabled the option). Otherwise, when I run the compile and link comands, I get a bunch of additional errors:
os_win.obj : error LNK2001: unresolved external symbol __security_cookie
So, Googling the vsprintf error, I came across suggestions to link with legacy_stdio_definitions.lib to access those functions, but that did not work (and using cygwin's nm.exe to examine the lib, showed that the vsprintf functions are Undefined.
If I build from the makefile, I lose the error about GsDriverEntry being undefined but I still have the vsprintf errors.
I tried also removing the /nodefaultlib link option... no effect.
So, I am at a complete loss as to what is going on. It makes no sense to me that, VS can build the project, but I cannot, using the same commands. What details or concept am I missing?
My link command line:
link /OUT:Win7Release/driver.sys \
/NOLOGO /INCREMENTAL:NO /IGNOREIDL /OPT:ICF /MAP /SUBSYSTEM:CONSOLE /OPT:REF \
/PDB:none /MACHINE:X64 /MANIFEST:NO /WX /PROFILE /kernel /Driver /RELEASE \
/VERSION:"10.0" /osversion:10.0 /ENTRY:"GsDriverEntry" \
/IGNORE:4198,4010,4037,4039,4065,4070,4078,4087,4089,4221,4108,4088,4218,4218,4235 \
/ERRORREPORT:PROMPT /MERGE:"_TEXT=.text;_PAGE=PAGE" /SECTION:"INIT,d" \
/IMPLIB:"Win7Release/driver.lib" /SUBSYSTEM:NATIVE",6.01" \
.. list of obj files .. \
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib \
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
legacy_stdio_definitions.lib ntoskrnl.lib hal.lib wmilib.lib BufferOverflowK.lib
Okay, well, I found this post, which helped me earlier this year with another similar problem... seems that vsprintf is also declared inline, now. Setting _NO_CRT_STDIO_INLINE as /D option to cl.exe allows the code to build AND link.
So.. why would the Visual Studio 2015 project build properly? That define is NOT in the build output.

Set up x64 in Visual C++ 2010

I am trying to learn x64 assembly using Visual Studion 2010.
I was following this video tutorial : x64 Assembly and C++ Tutorial 1: Getting into x64 ASM from C++
As it says, I installed Visual Studio 2010, windows 7 SDK 3.5 (ISO install) and edited the configuration.
But when I compile the code, I get following error :
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\masm.targets(49,5): error MSB3721: The command "ml64.exe /c /nologo /Zi /Fo"x64\Debug\asm.obj" /W3 /errorReport:prompt /Taasm.asm" exited with code 1.
What is this problem, and how can I solve it?
Look at the assembler output above that line, or build the .asm file by itself.
You should see warnings generated by the assembler
eg. "somefile.asm(564): warning A6004: procedure argument or local not referenced :"
Deal with those warnings. The "exited with code 1" is not very explanatory.

Building/Using CppUnit Library on VS2010

I downloaded and compiled CppUnit to compile with Visual Studio 2010.
After the conversion, I could load the CppUnitLibraries, and it gives me cppunit.lib and cppunit_dll.lib/dll. After copying the headers and libs to a directory, I run this command to get a lot of errors.
I found the conflict of libraries as follows
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
However, the following command doesn't seem to work.
cl main.cpp complex.cpp testset.cpp /I"C:\CppUnit\include" /link /libpath:"C:\CppUnit\lib" cppunit.lib /NODEFAULTLIB:library
What's wrong with them?
This is the command that I used for compilation/link.
cl main.cpp complex.cpp testset.cpp /I"C:\CppUnit\include" /link /libpath:"C:\CppUnit\lib" cppunit.lib
This is the error message from VS2010.
cppunit.lib(TestResult.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL':
...
node###Z) already defined in LIBCMT.lib(typinfo.obj)
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:lib
rary
main.exe : fatal error LNK1169: one or more multiply defined symbols found
ADDED
The CppUnit provides older version of project file (dsw), so I needed to convert the file to 2010 solution project manually.
For the error, missing /MD for compilation was the source of the problem. For other compilation warning, I needed to add /EHsc parameter.
cl /EHsc /MD /c /I"./CppUnit/include" main.cpp testset.cpp complex.cpp
link /libpath:"CppUnit/lib" main.obj testset.obj complex.obj cppunit.lib /out:cpptest_static.exe
link /libpath:"CppUnit/lib" main.obj testset.obj complex.obj cppunit_dll.lib /out:cpptest_dynamic.exe
seems like you compiled CppUnit in debug mode, weheras you're now compiling your current files in release mode. Those should not be mixed, and that's what the compiler is telling you.
The quickest way to resolve this would probably be to use a VS project, and check it's settings against the project used to compile CppUnit.
on your edit: you're also mixing runtime libraries (eg check that both are compiled using the /MD switch aka Multi-Threaded DLL)
I upgraded my CPPUNIT projects to visual studio 2010 and had to manually fix it.
The problem in the build was in the final actions where the output files are copied.
For the cppunit_dll project, one of the custom commands is:
copy "$(TargetPath)" ..\..\lib\$(TargetName).dll
copy "$(TargetDir)$(TargetName).lib" ..\..\lib\$(TargetName).lib
$(TargetName) is "cppunit_dll".
This conflicts with what we're actually building: if you look at the Linker options, you see that the output file name is "cppunitd_dll.dll".
The solution I used is to go to ConfigurationPropertys\General, and change "Target Name" from $(ProjectName) to"cppunitd_dll".
I had to to a similar solution for the cppunit project.
read INSTALL-VS.Net2008.txt in the cppunit folder after checking out the source code from SVN.
basically:
there is a visual studio solution under the examples folder.
that being said... i still can't get it to build without errors on vs2010 after converting it. i get 'cmd.exe' failed and failures to copy dlls.

Resources