I cannot debut a project in Code Blocks step by step - c++

I'm trying to debut my code step by step, but I don't know why it doesn't work.
The breakpoint is set but it seems to ignore it (doesn't appear the yellow arrow).
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\CodeBlocks\ArvoresBinarias2908\
Adding source dir: C:\CodeBlocks\ArvoresBinarias2908\
Adding file: C:\CodeBlocks\ArvoresBinarias2908\bin\Debug\ArvoresBinarias2908.exe
Changing directory to: C:/CodeBlocks/ArvoresBinarias2908/.
Set variable: PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Binn;C:\Program Files (x86)\Skype\Phone;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files\Microsoft SQL Server\120\DTS\Binn;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;C:\Program Files (x86)\Interactive Intelligence\ININ Trace Initialization;C:\Program Files (x86)\Interactive Intelligence\ICUserApps;C:\Program Files\Interactive Intelligence\ICUserApps
Starting debugger: C:\Program Files (x86)\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/CodeBlocks/ArvoresBinarias2908/bin/Debug/ArvoresBinarias2908.exe
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.5
Child process PID: 11644
[Inferior 1 (process 11644) exited normally]
Debugger finished with status 0
Can someone please help me? I've already tried somethings that I found online, but no success:
Tried with another code... no success.
Moved the project to a folder with no spaces
Checked true the "Produce debugging symbols" [-g]
Disabled the "Enable all common compiler warning..."
I really don't understand that much about Debuggers, Compilers... I just want to debug thsi code to see the variable changes and other stuff.
Thanks!
ps. This is my first question here, so sorry if I didn't follow all the rules and standards that everybody here is used to.

Related

LNK1181 error when compiling V8 engine on Win10

I'm following this guide on building V8 but I am hitting some issues on the compilation step. I am running Windows 10 x64. I am trying to compile with options to embed the engine also.
Running the following command:
ninja -C out.gn/x64.release
Gives me this error:
ninja: Entering directory `out.gn/x64.release'
[1/471] LINK mksnapshot.exe mksnapshot.exe.pdb
FAILED: mksnapshot.exe mksnapshot.exe.pdb
C:/Workspace/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb #./mksnapshot.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'comdlg32.lib'
ninja: build stopped: subcommand failed.
Now I believe I have narrowed down the error to looking for the .lib files in the wrong directory. I have (had) multiple versions installed, so there were multiple folders in my Windows Kit install.
Windows Kits/10/Lib/10.0.16299.0
Windows Kits/10/Lib/10.0.15xxx.0
If I dragged and dropped the comdlg32.lib file from 10.0.16299.0 into the 10.0.15xxx.0 directory then the error changed to a LNK1181 error with a different input file. I did this a few times but I was unsure if this was going to cause issues with different versions and there was probably going to be a lot.
I uninstalled the 10.0.15xxx.0 version which left behind the folder I mentioned, so I removed that and after doing so I have started getting the LNK1181 error with a different input file (advapi32.lib I assume the very first file it can't find). This is how I came to the conclusion about the path being incorrect.
So I have tried a few things to change the path (I hoped just uninstalling the old version would fix it) such as:
Uninstalling the old version.
Going through registry entries to see if I can find an install path or something using that path, which I didn't. I did notice that there was still installation and data in the registry for the 10.0.15xxx.0 install, I might try deleting that from the registry directly as a last resort?
I have tried to explicitly set the path by setting <TargetUniversalCRTVersion>10.0.16299.0</TargetUniversalCRTVersion> in this file: C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\uCRT.props
I have never used Ninja before so I tried looking for a way to set some kind of lib-path in the command but couldn't really find anything.
I looked through the python scripts being executed to try and locate something to do with the libs path but couldn't see anything.
I would be grateful for any help and suggestions. Thanks.
You can try to compile v8 using Visual Studio as explained here: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#using-the-visual-studio-ide
By running the following commands:
$ gn gen --ide=vs out.gn/x64.release
$ cd out.gn/x64.release
$ msbuild all.sln
You can see a full example here: https://github.com/phpv8/v8js/issues/272#issuecomment-262848754
Apparently this method is not officially supported anymore, but I had the same problem as you have and this solved the issue for me.
Note that after this I had another issue, the unit tests failed to be compiled due to a linking error, but I had the necessary libraries to use v8. So there may be deeper problem that is causing all of this that I'm missing.
Edit:
Also, you could try to set the following parameters with gn args:
visual_studio_path = "..."
visual_studio_version = "2017"
wdk_path = "..."
windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10"
To set those parameters, do:
gn args out.gn/x64.release
This will open a text editor where you can write the extra parameters you are interested in.
To see the full list of parameters you can specify:
gn args --list out.gn/x64.release
I was following this guide https://medium.com/dailyjs/how-to-build-v8-on-windows-and-not-go-mad-6347c69aacd4 and also ran into the error
LINK1181: cannot open input file 'advapi32.lib'
I'm pretty sure it was because I had the wrong versions of the Windows 10 SDK. Similar to you I had versions:
Windows Kits/10/Lib/10.0.10240.0
Windows Kits/10/Lib/10.0.16299.0
But according to https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Setting-up-Windows (Which I think is relevant) you need version 10.0.15063.0
After installing version 10.0.15063.0 (with the visual studio installer) to
Windows Kits/10/Lib/10.0.15063.0
I was able to continue with the build.

Microsoft.Cpp.Win32.Targets(62,5): error : Required file "" is missing

Today, I went to create a new C++ project in Visual Studio 2010 Pro, and then I compile it, I'm getting the following two errors:
1 error : Required file "" is missing. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets 62 6 Test
2 IntelliSense: cannot open source file "SDKDDKVer.h" c:\users\champad\documents\applications\leadinghedge-rebuild\leadinghedge\test\targetver.h 8 1 Test
The first error points to this tag in the Microsoft.Cpp.Win32.Targets file:
<CL Condition="'%(ClCompile.PrecompiledHeader)' == 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true'"
BuildingInIDE ="$(BuildingInsideVisualStudio)"
Sources ="#(ClCompile)"
AdditionalIncludeDirectories ="%(ClCompile.AdditionalIncludeDirectories)"
AdditionalOptions ="%(ClCompile.AdditionalOptions)"
AdditionalUsingDirectories ="%(ClCompile.AdditionalUsingDirectories)"
AssemblerListingLocation ="%(ClCompile.AssemblerListingLocation)"
AssemblerOutput ="%(ClCompile.AssemblerOutput)"
BasicRuntimeChecks ="%(ClCompile.BasicRuntimeChecks)"
BrowseInformation ="%(ClCompile.BrowseInformation)"
BrowseInformationFile ="%(ClCompile.BrowseInformationFile)"
BufferSecurityCheck ="%(ClCompile.BufferSecurityCheck)"
CallingConvention ="%(ClCompile.CallingConvention)"
CompileAsManaged ="%(ClCompile.CompileAsManaged)"
CompileAs ="%(ClCompile.CompileAs)"
DebugInformationFormat ="%(ClCompile.DebugInformationFormat)"
DisableLanguageExtensions ="%(ClCompile.DisableLanguageExtensions)"
DisableSpecificWarnings ="%(ClCompile.DisableSpecificWarnings)"
EnableEnhancedInstructionSet ="%(ClCompile.EnableEnhancedInstructionSet)"
EnableFiberSafeOptimizations ="%(ClCompile.EnableFiberSafeOptimizations)"
EnablePREfast ="%(ClCompile.EnablePREfast)"
ErrorReporting ="%(ClCompile.ErrorReporting)"
ExceptionHandling ="%(ClCompile.ExceptionHandling)"
ExcludedInputPaths ="$(ExcludePath)"
ExpandAttributedSource ="%(ClCompile.ExpandAttributedSource)"
FavorSizeOrSpeed ="%(ClCompile.FavorSizeOrSpeed)"
FloatingPointExceptions ="%(ClCompile.FloatingPointExceptions)"
FloatingPointModel ="%(ClCompile.FloatingPointModel)"
ForceConformanceInForLoopScope ="%(ClCompile.ForceConformanceInForLoopScope)"
ForcedIncludeFiles ="%(ClCompile.ForcedIncludeFiles)"
ForcedUsingFiles ="%(ClCompile.ForcedUsingFiles)"
FunctionLevelLinking ="%(ClCompile.FunctionLevelLinking)"
GenerateXMLDocumentationFiles ="%(ClCompile.GenerateXMLDocumentationFiles)"
IgnoreStandardIncludePath ="%(ClCompile.IgnoreStandardIncludePath)"
InlineFunctionExpansion ="%(ClCompile.InlineFunctionExpansion)"
IntrinsicFunctions ="%(ClCompile.IntrinsicFunctions)"
MinimalRebuild ="%(ClCompile.MinimalRebuild)"
MultiProcessorCompilation ="%(ClCompile.MultiProcessorCompilation)"
ObjectFileName ="%(ClCompile.ObjectFileName)"
OmitDefaultLibName ="%(ClCompile.OmitDefaultLibName)"
OmitFramePointers ="%(ClCompile.OmitFramePointers)"
OpenMPSupport ="%(ClCompile.OpenMPSupport)"
Optimization ="%(ClCompile.Optimization)"
PrecompiledHeader ="%(ClCompile.PrecompiledHeader)"
PrecompiledHeaderFile ="%(ClCompile.PrecompiledHeaderFile)"
PrecompiledHeaderOutputFile ="%(ClCompile.PrecompiledHeaderOutputFile)"
PreprocessKeepComments ="%(ClCompile.PreprocessKeepComments)"
PreprocessorDefinitions ="%(ClCompile.PreprocessorDefinitions)"
PreprocessSuppressLineNumbers ="%(ClCompile.PreprocessSuppressLineNumbers)"
PreprocessToFile ="%(ClCompile.PreprocessToFile)"
ProcessorNumber ="%(ClCompile.ProcessorNumber)"
ProgramDataBaseFileName ="%(ClCompile.ProgramDataBaseFileName)"
RuntimeLibrary ="%(ClCompile.RuntimeLibrary)"
RuntimeTypeInfo ="%(ClCompile.RuntimeTypeInfo)"
ShowIncludes ="%(ClCompile.ShowIncludes)"
SmallerTypeCheck ="%(ClCompile.SmallerTypeCheck)"
StringPooling ="%(ClCompile.StringPooling)"
StructMemberAlignment ="%(ClCompile.StructMemberAlignment)"
SuppressStartupBanner ="%(ClCompile.SuppressStartupBanner)"
TreatSpecificWarningsAsErrors ="%(ClCompile.TreatSpecificWarningsAsErrors)"
TreatWarningAsError ="%(ClCompile.TreatWarningAsError)"
TreatWChar_tAsBuiltInType ="%(ClCompile.TreatWChar_tAsBuiltInType)"
UndefineAllPreprocessorDefinitions ="%(ClCompile.UndefineAllPreprocessorDefinitions)"
UndefinePreprocessorDefinitions ="%(ClCompile.UndefinePreprocessorDefinitions)"
UseFullPaths ="%(ClCompile.UseFullPaths)"
UseUnicodeForAssemblerListing ="%(ClCompile.UseUnicodeForAssemblerListing)"
WarningLevel ="%(ClCompile.WarningLevel)"
WholeProgramOptimization ="%(ClCompile.WholeProgramOptimization)"
XMLDocumentationFileName ="%(ClCompile.XMLDocumentationFileName)"
CreateHotpatchableImage ="%(CLCompile.CreateHotpatchableImage)"
TrackerLogDirectory ="%(ClCompile.TrackerLogDirectory)"
TLogReadFiles ="#(CLTLogReadFiles)"
TLogWriteFiles ="#(CLTLogWriteFiles)"
ToolExe ="$(CLToolExe)"
ToolPath ="$(CLToolPath)"
TrackFileAccess ="$(TrackFileAccess)"
MinimalRebuildFromTracking ="%(ClCompile.MinimalRebuildFromTracking)"
ToolArchitecture ="$(CLToolArchitecture)"
TrackerFrameworkPath ="$(CLTrackerFrameworkPath)"
TrackerSdkPath ="$(CLTrackerSdkPath)"
TrackedInputFilesToIgnore ="#(ClNoDependencies)"
AcceptableNonZeroExitCodes ="%(ClCompile.AcceptableNonZeroExitCodes)"
YieldDuringToolExecution ="$(ClYieldDuringToolExecution)"
>
</CL>
I tried reinstalling the 7.1 SDK, however the installation files every time I try it. Is that what is causing this?
This fixed it for me:
First, I had an error where it couldn't find the WindowSDKDir property. I had to go to my project's settings->Configuration Properties->General->Platform Toolset and change it to Windows7.1SDK.
Then, I had the Required file "" is missing error. I had to open regedit and change:
HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder
from C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\ to C:\Program Files\Microsoft SDKs\Windows\v7.1\ (removed (x86)).
After that, CL.exe was exiting with code -1073741515. I had to add the following to my PATH:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
After all that work, it turns out the project I'm building is using some include files that only come with Visual Studio 2010, so I have to go install the whole dang thing anyway.
Hopefully this is of help to someone else, and I haven't just wasted my afternoon. :P

Visual Studio 2012 build hangs

As recently as the last few days, a project I'm working on in MSVS2012 has begun hanging on build. I've taken steps trying to log what VS is doing as in the following link : How to Troubleshoot Visual Studio 2012 Hangs/Lockups but have not been able to find any "errors" or anything that "fails" to load. The build will finish, but it now takes several minutes as opposed to a few seconds. Anytime I attempt to cancel the build, I get a generic message about how the system is waiting on "GenerateDeps" to finish.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets(402,9): warning MSB4220: Waiting for the currently executing task "GenerateDeps" to cancel.
EDIT
Here's some additional verbose/diagnostic output. This seems to be where VS is lagging...
Input file "GPU RKF45 (Variable Step Size).cu" is newer than output file "x64\Debug\GPU RKF45 (Variable Step Size).cu.deps".
1>Using "GenerateDeps" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\Nvda.Build.CudaTasks.v6.0.dll".
1>Task "GenerateDeps" (TaskId:23)
1> Task Parameter:
1> AdditionalIncludeDirs=
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin
1> C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include
1> . (TaskId:23)
1> Task Parameter:ForcedIncludeFiles=cuda_runtime.h (TaskId:23)
1> Task Parameter:
1> PreprocessorDefinitions=
1> __CUDACC__
1> _MBCS (TaskId:23)
1> Task Parameter:SourceFile=C:\Users\Karsten Chu\New Google Drive\Research\Visual Studio 2012\Projects\Dynamic Parallelism Test\Dynamic Parallelism Test\GPU RKF45 (Variable Step Size).cu (TaskId:23)
1> Command: (TaskId:23)
1> The "GenerateDeps" task is using "cl.exe" from "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\cl.exe". (TaskId:23)
I have had problems with hanging builds in VS some long time ago and I traced back the root cause to be always resource related. Such as a slow processor (yes, it matters when you compile!), or not enough memory. The only solution that worked for me was always a full rebuild (clean) and leave the computer alone while it builds. This might or might not help you, if you share more information someone might have a deeper insight.
I have frequently been able to recover Visual Studio 2012 from hanging when a build fails with the message "Waiting for the currently executing task "CL" to cancel." by ending all of the "cl" processes. For example, open up the Windows task manager and find all the processes named "cl.exe" (which is the MSVC compiler) and end process on them. Visual Studio resumes operation shortly thereafter.
If there are additional/custom build tasks, there may be other processes running. For example, if a custom build event launches an executable, that executable process may need to be killed as well.
I found vc12 build will appear to hang if you make an error in project properties such that an output folder is invalid.
eg want to set OutputDirectory to something but due a typo when editing the property it resolves to an invalid path.
Instead of giving an invalid path error the build appears to hang.
I say appears to hang because what actually happens is does nothing for a long time during which you cannot cancel the build of exit DevStudio.
Eventually (several minutes) it gives an error but that time is so long it looks like a hang.
I had to replace cl.exe /E option to /P within Nvda.Build.CudaTasks.vX.Y.dll files to evade the problem. There wasn't the problem few days ago so I'm not sure at all why the problem has surfaced.

Opensteer project file conversion and compilation

Opensteer is a library which aims to provide agent behaviors for real time games.
I tried to compile it, but I have an error and I have no clue what it means. When I click on it, it opens a MSVC file.
Error 3 error MSB3073: The command "mkdir "C:\opensteer\win32\\lib"
copy "C:\opensteer\win32\Debug\opensteer.lib" "C:\opensteer\win32\\lib"
:VCEnd" exited with code 1. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 113
I've no idea why there is somehow a folder name thing missing between the two \\
It's only the source package provided here http://sourceforge.net/projects/opensteer/files/opensteer/OpenSteer%200.8.2/

Problem while building a .dll (Visual C++)

I am trying to build a .dll in order to link it to one of my projects. But the build always fails : I got these messages in the output and I don't know what it means. It seems that something is missing, but I couldn't find what.
I am trying to link a Mesher called Netgen
http://www.hpfem.jku.at/netgen/
1>adfront2.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1> Creating library D:\Documents\Visual Studio 2008\Projects\converter/lib\nglib.lib and object D:\Documents\Visual Studio 2008\Projects\converter/lib\nglib.exp
1>Embedding manifest...
1>Performing Post-Build Event...
1>Environment variable NETGENDIR not found.... using default location!!!
1>POSTBUILD Script for nglib ........
1>Installing required files into XXX\Netgen\windows....\nglib-instNoOCC_Win32 ....
1>File not found - nglib.dll
1>0 File(s) copied
1>POSTBUILD Script for nglib FAILED..... Error copying the nglib DLL into install folder!!!
1>Project : error PRJ0002 : Error result 1 returned from 'C:\Windows\SysWow64\cmd.exe'.
1>Build log was saved at "file://D:\Documents\Visual Studio 2008\Projects\converter\BuildLog_nglib.htm"
1>nglib - 1 error(s), 49 warning(s)
I hope I am clear enough and thank you by advance for your help.
seems this NetGen lib's project wants to run a post-build event in which it tries to copy the main output (the nglib.dll) to the directory NETGENDIR (which is supposed to be an environment variable). This fails beccuse the dll isn't found.
Either disable the post build event, or check with the NetGen lib's creator what they expect here, there seems to be a mismatch between the project's output dir and the postbuild event.
Would also be nice to see the postbuild event from the vcproj file, maybe you can post it?
You need read, by example the output line:
1>Environment variable NETGENDIR not found.... using default location!!!
After that I suggest that you must read the documentation about how define a enviroment variable named: NETGENDIR