Thread: how to compile projects ?

  1. #16
    Registered User
    Join Date
    Nov 2007
    Posts
    164
    I want to compile this whole project (see link below)


    While building the loggertest_src.zip solution I get it to compile but I got three warnings.

    The following is the log for the loggertest_src.zip solution
    In it the log says WINVER not defined. How to define it for Windows XP, it says defaulting

    to VISTA, but I'm running XP. And there are three warnings.

    Code:
    1>------ Rebuild All started: Project: LoggerTest, Configuration: Debug Win32 ------
    1>Deleting intermediate and output files for project 'LoggerTest', configuration 
    
    'Debug|Win32'
    1>Compiling...
    1>StdAfx.cpp
    1> WINVER not defined. Defaulting to 0x0600 (Windows Vista)
    1>Compiling...
    1>ClientPipeInstance.cpp
    1>Logger.cpp
    1>c:\documents and 
    
    settings\manzoor\desktop\loggertest_src\usr\src\logger\common\logger.cpp(128) : warning 
    
    C4996: '_snprintf': This function or variable may be unsafe. Consider using _snprintf_s 
    
    instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : see 
    
    declaration of '_snprintf'
    1>c:\documents and 
    
    settings\manzoor\desktop\loggertest_src\usr\src\logger\common\logger.cpp(130) : warning 
    
    C4996: '_vsnprintf': This function or variable may be unsafe. Consider using _vsnprintf_s 
    
    instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(358) : see 
    
    declaration of '_vsnprintf'
    1>LoggerTest.cpp
    1>c:\documents and 
    
    settings\manzoor\desktop\loggertest_src\usr\src\logger\loggertest\loggertest.cpp(54) : 
    
    warning C4996: 'CWinApp::Enable3dControlsStatic': CWinApp::Enable3dControlsStatic is no 
    
    longer needed. You should remove this call.
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\afxwin.h(4821) : 
    
    see declaration of 'CWinApp::Enable3dControlsStatic'
    1>LoggerTestDlg.cpp
    1>SecurityToken.cpp
    1>Sleeper.cpp
    1>Generating CODE...
    1>Compiling resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Compiling manifest to resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Linking...
    1>Embedding manifest...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Build log was saved at "file://C:\Documents and 
    
    Settings\Manzoor\Desktop\loggertest_src\usr\src\logger\LoggerTest\Debug\BuildLog.htm"
    1>LoggerTest - 0 error(s), 3 warning(s)
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    >
    Now how to compile the loggerclient_src.zip, all it contains are header files and .cpp

    files. Should I create a new project and import all the files and then simply build the it.

    And with loggerservice_src.zip, when I opened the .dsw file (VC++ 6 Workspace) I got the

    offer to convert it to the current C++ project format, so I clicked Yes to All, and after

    that another window popped up which says "The source control provider associated with this

    solution could not be found. The projects will be treated as not under source control.

    Do you want to permanently remove the source control bindings from the projects?"

    I got the option of Yes, No, Help

    When I clicked Yes, I got this log

    Code:
    1>------ Build started: Project: logger, Configuration: Debug Win32 ------
    1>Creating Type Library...
    1>Processing .\logger.idl
    1>logger.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.idl
    1>oaidl.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\objidl.idl
    1>objidl.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\unknwn.idl
    1>unknwn.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\wtypes.idl
    1>wtypes.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\basetsd.h
    1>basetsd.h
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\guiddef.h
    1>guiddef.h
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.idl
    1>ocidl.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oleidl.idl
    1>oleidl.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\servprov.idl
    1>servprov.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\urlmon.idl
    1>urlmon.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\msxml.idl
    1>msxml.idl
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\oaidl.acf
    1>oaidl.acf
    1>Processing C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\ocidl.acf
    1>ocidl.acf
    1>Compiling...
    1>StdAfx.cpp
    1>statreg.cpp is obsolete. Please remove it from your project.
    1>atlimpl.cpp is obsolete. Please remove it from your project.
    1>Compiling...
    1>logger.cpp
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) 
    
    : error C2220: warning treated as error - no 'object' file generated
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) 
    
    : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) 
    
    has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : 
    
    see declaration of 'ATL::CRegKey::SetValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(91) 
    
    : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) 
    
    has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : 
    
    see declaration of 'ATL::CRegKey::SetValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(252) 
    
    : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using 
    
    vsprintf_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help 
    
    for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see 
    
    declaration of 'vsprintf'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(444) 
    
    : warning C4996: 'ATL::CRegKey::QueryValue': CRegKey::QueryValue(TCHAR *value, TCHAR 
    
    *valueName) has been superseded by CRegKey::QueryStringValue and 
    
    CRegKey::QueryMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5135) : 
    
    see declaration of 'ATL::CRegKey::QueryValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(518) 
    
    : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using 
    
    _tcstok_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for 
    
    details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see 
    
    declaration of '_tcstok'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(519) 
    
    : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using 
    
    _tcstok_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for 
    
    details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see 
    
    declaration of '_tcstok'
    1>LogInstance.cpp
    1>c:\documents and 
    
    settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : error 
    
    C2220: warning treated as error - no 'object' file generated
    1>c:\documents and 
    
    settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : warning 
    
    C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s 
    
    instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see 
    
    declaration of '_splitpath'
    1>LogMap.cpp
    1>PipeData.cpp
    1>SecurityToken.cpp
    1>ServerPipeInstance.cpp
    1>Sleeper.cpp
    1>Generating CODE...
    1>Build log was saved at "file://C:\Documents and 
    
    Settings\Manzoor\Desktop\loggerservice_src\usr\src\logger\Debug\BuildLog.htm"
    1>logger - 2 error(s), 7 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Now when I clicked No, I got this log
    Code:
    1>------ Build started: Project: logger, Configuration: Debug Win32 ------
    1>Compiling...
    1>StdAfx.cpp
    1>statreg.cpp is obsolete. Please remove it from your project.
    1>atlimpl.cpp is obsolete. Please remove it from your project.
    1>Compiling...
    1>logger.cpp
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) 
    
    : error C2220: warning treated as error - no 'object' file generated
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(90) 
    
    : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) 
    
    has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : 
    
    see declaration of 'ATL::CRegKey::SetValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(91) 
    
    : warning C4996: 'ATL::CRegKey::SetValue': CRegKey::SetValue(TCHAR *value, TCHAR *valueName) 
    
    has been superseded by CRegKey::SetStringValue and CRegKey::SetMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5123) : 
    
    see declaration of 'ATL::CRegKey::SetValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(252) 
    
    : warning C4996: 'vsprintf': This function or variable may be unsafe. Consider using 
    
    vsprintf_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help 
    
    for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdio.h(366) : see 
    
    declaration of 'vsprintf'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(444) 
    
    : warning C4996: 'ATL::CRegKey::QueryValue': CRegKey::QueryValue(TCHAR *value, TCHAR 
    
    *valueName) has been superseded by CRegKey::QueryStringValue and 
    
    CRegKey::QueryMultiStringValue
    1>        f:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlbase.h(5135) : 
    
    see declaration of 'ATL::CRegKey::QueryValue'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(518) 
    
    : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using 
    
    _tcstok_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for 
    
    details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see 
    
    declaration of '_tcstok'
    1>c:\documents and settings\manzoor\desktop\loggerservice_src\usr\src\logger\logger.cpp(519) 
    
    : warning C4996: '_tcstok': This function or variable may be unsafe. Consider using 
    
    _tcstok_s instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for 
    
    details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\tchar.h(1550) : see 
    
    declaration of '_tcstok'
    1>LogInstance.cpp
    1>c:\documents and 
    
    settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : error 
    
    C2220: warning treated as error - no 'object' file generated
    1>c:\documents and 
    
    settings\manzoor\desktop\loggerservice_src\usr\src\logger\loginstance.cpp(174) : warning 
    
    C4996: '_splitpath': This function or variable may be unsafe. Consider using _splitpath_s 
    
    instead. To disable deCODEcation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
    1>        f:\program files\microsoft visual studio 9.0\vc\include\stdlib.h(786) : see 
    
    declaration of '_splitpath'
    1>Generating CODE...
    1>Skipping... (no relevant changes detected)
    1>LogMap.cpp
    1>PipeData.cpp
    1>SecurityToken.cpp
    1>ServerPipeInstance.cpp
    1>Sleeper.cpp
    1>Build log was saved at "file://c:\Documents and 
    
    Settings\Manzoor\Desktop\loggerservice_src\usr\src\logger\Debug\BuildLog.htm"
    1>logger - 2 error(s), 7 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Would anyone tell me a way to compile this whole project?

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    For the first, you don't really need to do anything because they're all warnings.
    For the second, sorry, no idea about source controls.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Registered User
    Join Date
    Nov 2007
    Posts
    164
    To simplify it all, I have to build this project
    http://www.codeproject.com/KB/cpp/loggerservice.aspx
    The files are in the link above

    There are errors in the last log of my previous post. See, then how could you say there are only warnings, if there were warnings only I would be able to compile it successfully

    There are three files, I have compiled successfully the last one (test project)
    But I can't compile the rest. (service source file and client source file) I have posted the logs I got when compiling the service source files and there are 2 errors, see the log yourself (the last one in previous post)

    What I want is to compile the service source file successfully, thats the main problem that project has got the errors
    Last edited by manzoor; 07-26-2008 at 05:18 AM.

  4. #19
    Registered User
    Join Date
    Aug 2005
    Location
    Austria
    Posts
    1,990
    See, then how could you say there are only warnings, if there were warnings only I would be able to compile it successfully
    Code:
     error C2220: warning treated as error - no 'object' file generated
    That's why compiling fails without errors.
    use less strict compiler switches or
    Code:
    #define _CRT_SECURE_NO_WARNINGS
    to avoid the stupid "This function or variable may be unsafe." warnings
    Kurt

  5. #20
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I wouldn't call them stupid. They are good warnings. It's a good thing to make secure applications!
    Just "to get rid of the warnings" would do fine.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #21
    Registered User
    Join Date
    Nov 2007
    Posts
    164
    I disabled the Treat warnings as errors and it compiled successfully, but the loggerclient_src is still remaining although those files are included in loggertest_src, so do I still need them to compile in order to completely compile the whole project, if so, then how to do that ? Because I created a new project and exported all the files in loggerclient_src but it didn't worked

  7. #22
    Registered User
    Join Date
    Nov 2007
    Posts
    164
    Any response ?

  8. #23
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    I have no idea what you're trying to say in your 2nd to last response.

  9. #24
    Registered User
    Join Date
    Nov 2007
    Posts
    164
    There are three files on the link given
    http://www.codeproject.com/KB/cpp/loggerservice.aspx

    1. client source files
    2. service source files
    3. test project

    I have compiled the test project and service source files
    but I haven't compiled the client source files, I don't know how to. And I want to say that the files in client source files are also included in test project so is there any need to compile them, to successfully compile the whole project ? If so, how to do them, because I created a new project and exported all the files of client source files and then build solution but I was getting errors. I have posted the log here
    Code:
    1>------ Build started: Project: loggerclient, Configuration: Debug Win32 ------
    1>Compiling...
    1>ClientPipeInstance.cpp
    1>c:\documents and settings\manzoor\desktop\loggerclient_src\usr\src\logger\common\clientpipeinstance.cpp(10) : fatal error C1083: Cannot open precompiled header file: 'Debug\loggerclient.pch': No such file or directory
    1>Logger.cpp
    1>c:\documents and settings\manzoor\desktop\loggerclient_src\usr\src\logger\common\logger.cpp(10) : fatal error C1083: Cannot open precompiled header file: 'Debug\loggerclient.pch': No such file or directory
    1>SecurityToken.cpp
    1>c:\documents and settings\manzoor\desktop\loggerclient_src\usr\src\logger\common\securitytoken.cpp(14) : fatal error C1083: Cannot open precompiled header file: 'Debug\loggerclient.pch': No such file or directory
    1>Sleeper.cpp
    1>c:\documents and settings\manzoor\desktop\loggerclient_src\usr\src\logger\common\sleeper.cpp(10) : fatal error C1083: Cannot open precompiled header file: 'Debug\loggerclient.pch': No such file or directory
    1>Generating Code...
    1>Build log was saved at "file://c:\Documents and Settings\Manzoor\My Documents\Visual Studio 2008\Projects\loggerclient\loggerclient\Debug\BuildLog.htm"
    1>loggerclient - 4 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  10. #25
    C++Pandit
    Join Date
    Jul 2008
    Posts
    49
    just , save the header file in the project window. then build the project.
    I would rather be hated for who I am than be loved for who I am not!

  11. #26
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It seems that the precompiled headers are either not built or are causing problems.
    Goto project options and precompiled headers and select create and then compile, then switch back to use. Or if it doesn't work, you can disable them completely by selecting not using.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #27
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by manzoor View Post
    I disabled the Treat warnings as errors and it compiled successfully, but the loggerclient_src is still remaining although those files are included in loggertest_src, so do I still need them to compile in order to completely compile the whole project, if so, then how to do that ? Because I created a new project and exported all the files in loggerclient_src but it didn't worked
    If you treat your warnings as errors then what do you expect to happen when a warning is encountered?

    Quote Originally Posted by Elysia
    I wouldn't call them stupid. They are good warnings. It's a good thing to make secure applications!
    Just "to get rid of the warnings" would do fine.
    Yet you always push people to conform to the standard. The *_s functions are not standard at all. To be blunt, they are not even standard across all versions of MSVC++.

    Quote Originally Posted by manzoor
    There are three files on the link given
    http://www.codeproject.com/KB/cpp/loggerservice.aspx
    Clearly the code is compileable, so the problem is all on your end.

  13. #28
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by master5001 View Post
    Yet you always push people to conform to the standard. The *_s functions are not standard at all.
    Yes, I do. But even if certain functions are non-standard, yet their advantages surpass the disadvantages, I would still recommend them.
    Btw, I believe they are from a draft or something some standardized library that is not yet part of the C standard.

    To be blunt, they are not even standard across all versions of MSVC++.
    They exist in Visual Studio .NET and above. There's no reason to avoid them for that reason.
    Plus they are more secure. Security issues are a big problem today, and because C has many many unsecure functions, these more secure functions are a welcome addition.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #29
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I am not saying don't use them, as much as I am saying that you have to pick a side of the fense to stand on sometimes.

    In any event, since most of what makes these functions unsafe has a lot to do with the programmer than the C standard library, I do think its still possible to avoid these functions most of the time.

  15. #30
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> just , save the header file in the project window. then build the project. <<

    This is an old thread. Generally we don't resurrect old threads to give additional advice since it is likely that the problem has either been solved or worked around in the months that have passed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile as you type
    By Rocketmagnet in forum A Brief History of Cprogramming.com
    Replies: 33
    Last Post: 12-07-2006, 01:36 PM
  2. How to compile mfc libs from platform sdk
    By tjcbs in forum Windows Programming
    Replies: 6
    Last Post: 11-19-2006, 08:20 AM
  3. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  4. open scene graph compile issues
    By ichijoji in forum Game Programming
    Replies: 1
    Last Post: 08-04-2005, 12:31 PM
  5. compile program?
    By Goosie in forum C++ Programming
    Replies: 9
    Last Post: 06-22-2005, 02:26 PM