Ty very much for all the advises. I put below all the procedure i do in my intent to make it work the compiler c++ of visual studio with code::block
for anyone can found this useful.
SET UP SEARCH DIRECTORIES (note avoid the last "/") go to Settings -> Compiler -> Select Visual Studio 2010 Compiler -> Search Directories ->:
Compiler :
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include
Linker :
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
C:\Program Files (x86)\Windows Kits\8.1\Lib
C:\Program Files (x86)\Windows Kits\10\Lib
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86
Resource Compiler:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include
NOTE: THIS CAN BE WORK WITH OTHER COMBINATION OF LIBRARY AND RESOURCE I JUST GIVE A IDEA OF THE PROBLEM NOT ALL THIS DIRECTORIES ARE NECESSARY
Now i put all the exception i have encounter try to build a simple hello programm with the solution i have used :
Ty very much for the advise.
Exception 1:
LINK : fatal error LNK1561: entry point must be defined
Solution 1: Settings -> Compiler -> Select Visual Studio 2010 Compiler -> Linker Settings -> Other Link Options -> ADD "/SUBSYSTEM:CONSOLE"
Exception 2:
link.exe /nologo /subsystem:windows /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib" /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\lib\" /out:TestApp.exe Debug\TestAppDlg.obj Debug\stdafx.obj Debug\TestApp.obj Debug\TestApp.res
LINK : warning LNK4001: no object files specified; libraries used
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : fatal error LNK1159: no output file specified
Solution 2: Make sure to remove or the final "/" from all the Search Directories (Compiler,Linker,Resources Compiler);
Exception 3:
link.exe /nologo /subsystem:windows /LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\Lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib" /LIBPATH:"C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86" /out:bin\Debug\test3.exe obj\Debug\main.obj
LINK : fatal error LNK1104: cannot open file 'libucrt.lib'
Solution 3: Settings -> Compiler -> Select Visual Studio 2010 Compiler -> Search Directories -> Linker ->
-> Add "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86" (if you use 32 bit)
-> Add "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" (if you use 64 bit)
Exception 4:
.......
LIBCMT.lib(exe_winmain.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function "int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ)
bin\Debug\test3.exe : fatal error LNK1120: 1 unresolved externals
Solution 4: Settings -> Compiler -> Select Visual Studio 2010 Compiler -> Linker Settings -> Other Linker Settings -> ADD "/SUBSYSTEM:CONSOLE /NODEFAULTLIB:msvcrt"
Exception 5: The console outout of the program open and close instant
Solution 5: The Last Problem is caused from the use of "/SUBSYSTEM:CONSOLE " the program is work but the console open and close istant for now i just use like temporary solution tha code "system("pause");"
at the end of the main method theonly problem is that can't be work with the debugger.
NOW WE MUST SET UP THE DEBUGGER:
- Go to the page
https://msdn.microsoft.com/en-us/library/windows/hardware/ff551063(v=vs.85).aspx - Install the debugger how you more like it
- Check where the file cdb.exe is located and add the path to the Settings -> Debugger -> Executable Path
Exception5:
*** WARNING: Unable to verify checksum for image00090000
*** ERROR: Module load completed but symbols could not be loaded for image00090000
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\CRYPTBASE.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\SspiCli.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\msvcrt.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\sechost.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\ADVAPI32.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\bcryptPrimitives.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\RPCRT4.dll -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\KERNEL32.DLL -
*** ERROR: Symbol file could not be found. Defaulted to export symbols for C:\Windows\SysWOW64\KERNELBASE.dll -
Solution5: Download SYmbole for windows debug from
https://developer.microsoft.com/en-us/windows/hardware/download-symbols AND Setup the enviroment variable "_NT_SYMBOL_PATH"
At this point i will try to make it work the debuggger. hope to update this post.
Greetings All.