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. Static Library Issue

Static Library Issue

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++cssvisual-studio
4 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.
  • D Offline
    D Offline
    dehseth
    wrote on last edited by
    #1

    Hey ppl, I have create a static library project and build it successfully on debug mode and release mode. :thumbsup: Now I have a different project which uses this static library with #paragma comment (lib, mylib) When I compile and run my project in debug mode it runs successfully. :) When I compile my project in release mode it compiles successfully but wont run. :doh: And when I try to run release mode inside Visual Studio it gives me these errors: Error 1 fatal error C1083: Cannot open source file: '.\XWindow.cpp': No such file or directory c1xx Error 2 fatal error C1083: Cannot open source file: '.\XTexture.cpp': No such file or directory c1xx Error 3 fatal error C1083: Cannot open source file: '.\XTextBox.cpp': No such file or directory c1xx Error 4 fatal error C1083: Cannot open source file: '.\XText.cpp': No such file or directory c1xx Error 5 fatal error C1083: Cannot open source file: '.\XPen.cpp': No such file or directory c1xx :wtf: ... list goes on. These files are included in mylib.lib that's why I used static lib. So why this happens? :confused: One more thing, my library's file size in debug mode is 3.103Kb and in release mode 11.349Kb. I expect it would be more less in relase mode.. :~ Thank you... :-D

    C D 2 Replies Last reply
    0
    • D dehseth

      Hey ppl, I have create a static library project and build it successfully on debug mode and release mode. :thumbsup: Now I have a different project which uses this static library with #paragma comment (lib, mylib) When I compile and run my project in debug mode it runs successfully. :) When I compile my project in release mode it compiles successfully but wont run. :doh: And when I try to run release mode inside Visual Studio it gives me these errors: Error 1 fatal error C1083: Cannot open source file: '.\XWindow.cpp': No such file or directory c1xx Error 2 fatal error C1083: Cannot open source file: '.\XTexture.cpp': No such file or directory c1xx Error 3 fatal error C1083: Cannot open source file: '.\XTextBox.cpp': No such file or directory c1xx Error 4 fatal error C1083: Cannot open source file: '.\XText.cpp': No such file or directory c1xx Error 5 fatal error C1083: Cannot open source file: '.\XPen.cpp': No such file or directory c1xx :wtf: ... list goes on. These files are included in mylib.lib that's why I used static lib. So why this happens? :confused: One more thing, my library's file size in debug mode is 3.103Kb and in release mode 11.349Kb. I expect it would be more less in relase mode.. :~ Thank you... :-D

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      dehseth wrote:

      When I compile my project in release mode it compiles successfully but wont run. D'Oh! And when I try to run release mode inside Visual Studio it gives me these errors:

      What do you mean by "Run" ? These errors are compilation errors, you can't have those when you run your program :confused:

      dehseth wrote:

      Error 1 fatal error C1083: Cannot open source file: '.\XWindow.cpp': No such file or directory c1xx

      What is "c1xx" at the end ? Those files which give errors (XWindow.cpp, XTexture.cpp, ...), are they part of your exe or part of your static lib ?

      Cédric Moonen Software developer
      Charting control [v1.5] OpenGL game tutorial in C++

      D 1 Reply Last reply
      0
      • C Cedric Moonen

        dehseth wrote:

        When I compile my project in release mode it compiles successfully but wont run. D'Oh! And when I try to run release mode inside Visual Studio it gives me these errors:

        What do you mean by "Run" ? These errors are compilation errors, you can't have those when you run your program :confused:

        dehseth wrote:

        Error 1 fatal error C1083: Cannot open source file: '.\XWindow.cpp': No such file or directory c1xx

        What is "c1xx" at the end ? Those files which give errors (XWindow.cpp, XTexture.cpp, ...), are they part of your exe or part of your static lib ?

        Cédric Moonen Software developer
        Charting control [v1.5] OpenGL game tutorial in C++

        D Offline
        D Offline
        dehseth
        wrote on last edited by
        #3

        Application compiles and link successfully: ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== But when I double click to generated exe file it crashed X| So I open visual studio window and press Run button and it gives me these errors :wtf: I do not get why I get em. There's no c1xx file... :confused: Should I do anything more than putting #pragma comment (lib, "mylib") and include the main header file to make it run on release mode? :confused:

        1 Reply Last reply
        0
        • D dehseth

          Hey ppl, I have create a static library project and build it successfully on debug mode and release mode. :thumbsup: Now I have a different project which uses this static library with #paragma comment (lib, mylib) When I compile and run my project in debug mode it runs successfully. :) When I compile my project in release mode it compiles successfully but wont run. :doh: And when I try to run release mode inside Visual Studio it gives me these errors: Error 1 fatal error C1083: Cannot open source file: '.\XWindow.cpp': No such file or directory c1xx Error 2 fatal error C1083: Cannot open source file: '.\XTexture.cpp': No such file or directory c1xx Error 3 fatal error C1083: Cannot open source file: '.\XTextBox.cpp': No such file or directory c1xx Error 4 fatal error C1083: Cannot open source file: '.\XText.cpp': No such file or directory c1xx Error 5 fatal error C1083: Cannot open source file: '.\XPen.cpp': No such file or directory c1xx :wtf: ... list goes on. These files are included in mylib.lib that's why I used static lib. So why this happens? :confused: One more thing, my library's file size in debug mode is 3.103Kb and in release mode 11.349Kb. I expect it would be more less in relase mode.. :~ Thank you... :-D

          D Offline
          D Offline
          dehseth
          wrote on last edited by
          #4

          I just delete all Temp files Debug Output files and Release output files. Rebuild library. And rebuil application. Now it runs.. :thumbsup: Sometimes we need housekeeping i guess.. ;)

          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