Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. [build c++ by command line on windows OS][visual studio 2008]

[build c++ by command line on windows OS][visual studio 2008]

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++csharpsharepointvisual-studio
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thong LeTrung
    wrote on last edited by
    #1

    i have main.cpp ,makefile , build.bat //----------main.cpp---------------------------- #include int main() { std::cout << "hello world." << std::endl; return 0; } //--------------makefile------------------------- foo: main.cpp CL main.cpp //-------------build.bat-------------------------- @echoOFF echo buid by commnand line nmake echo ============================= echo run main.exe echo ============================= main.exe i use "Visual Studio command prompt " to run build.bat file . + with visual studio 2010 : ok + with visual studio 2008 : error please help me how to fix on visual 2008 . Thanks Thong LT ============================visual studio 2010================ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd c:\Users\ttle\Desktop\ demo c:\Users\ttle\Desktop\demo>build.bat buid by commnand line Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. CL main.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. S pecify /EHsc Microsoft (R) Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:main.exe main.obj ============================= run main.exe ============================= hello world. //====================Visual studio 2008 ---------------- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : war ning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp ecify /EHsc Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:main.exe main.obj LINK : fatal error LNK1104: cannot open file 'kernel32.lib' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\CL.EXE"' : return code '0x2' Stop. ============================= run main.exe ============================= 'main.exe' is not recognized as an internal or external command, operable program or batch file.

    L 1 Reply Last reply
    0
    • T Thong LeTrung

      i have main.cpp ,makefile , build.bat //----------main.cpp---------------------------- #include int main() { std::cout << "hello world." << std::endl; return 0; } //--------------makefile------------------------- foo: main.cpp CL main.cpp //-------------build.bat-------------------------- @echoOFF echo buid by commnand line nmake echo ============================= echo run main.exe echo ============================= main.exe i use "Visual Studio command prompt " to run build.bat file . + with visual studio 2010 : ok + with visual studio 2008 : error please help me how to fix on visual 2008 . Thanks Thong LT ============================visual studio 2010================ C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd c:\Users\ttle\Desktop\ demo c:\Users\ttle\Desktop\demo>build.bat buid by commnand line Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. CL main.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : wa rning C4530: C++ exception handler used, but unwind semantics are not enabled. S pecify /EHsc Microsoft (R) Incremental Linker Version 10.00.40219.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:main.exe main.obj ============================= run main.exe ============================= hello world. //====================Visual studio 2008 ---------------- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : war ning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp ecify /EHsc Microsoft (R) Incremental Linker Version 9.00.30729.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:main.exe main.obj LINK : fatal error LNK1104: cannot open file 'kernel32.lib' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\CL.EXE"' : return code '0x2' Stop. ============================= run main.exe ============================= 'main.exe' is not recognized as an internal or external command, operable program or batch file.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Thong LeTrung wrote:

      LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

      You should investigate why this message is being produced, and what directories are missing or not available in the 2008 build.

      Veni, vidi, abiit domum

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups