Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:22:40+00:00 2026-06-13T13:22:40+00:00

Finally, after whole day spent, I’ve made my CMake based project to successfully compile

  • 0

Finally, after whole day spent, I’ve made my CMake based project to successfully compile project on Windows(I’ve been developing it in Linux) and it even links well together, perfect isn’t it? Now I launch the program and boom, it’s not able to find dll libraries.

So, The problem:

I have CMake project with library and executable inside, that executable is using project’s library. I also have many third party libraries in project. It compiles and links well. When I try to launch it it prints error that project’s library wasn’t found. I’ve copied it to the executable’s directory. Now it prints that 3rd party library wasn’t found, I’ve copied all of them to exe’s dir. Now it prints that gcc’s library wasn’t found, so I’ve added C:\MinGW\bin to the path and now it launches fine.

But I feel it’s not the proper way. I’d like to spare my teammates(new) of that pain of launching.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:22:41+00:00Added an answer on June 13, 2026 at 1:22 pm

    Either link everything statically, or add necessary install() calls into your CMakeLists.txt. Install all needed libs into the same directory and run executable from there.

    If you want to run executable from CMAKE_BINARY_DIR, you can

    set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
    set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
    set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
    

    This would make CMake to put linked binaries into the same dir.

    As for gcc runtime – there is no other way except copying dll or linking statically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After a whole-day's study && trying, i finally give up upload files by pure
After writing a whole bunch of code - i am finally waking up to
Now, finally after 12 years, when all the world is hopping into CSS3 media
Edit2: After finally being able to profile the two against each other, it appears
SOLVED: Crap... why is it always you figure something out right AFTER you finally
After using a few validation libraries I finally decided to roll my own implementation,
After many hair-pulling frustrations I've finally got one version of the PerlMagick module working
After going through the effort of finally purging distro ruby packages from my Ubuntu
After searching a lot i did not get any answers and finally i had
after hours of tracking mysterious one or two seconds long lasting freeze I finally

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.