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 8684973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:26:33+00:00 2026-06-12T22:26:33+00:00

When using Boost.Test, there is generally no need to define a main() function, since

  • 0

When using Boost.Test, there is generally no need to define a main() function, since Boost.Test provides one itself.

I recently had to convert my project to use static linking of 3rd party libraries (on VS2010). Naturally, I had to link to multiple .libs so that the build succeeds, and my build ran just fine.

However, when I ran my test project, something really strange happened. It seems that one of the 3rd party .libs (libpng), required by one of my dependent libraries, contained a test file with a main() function defined within (pngtest.c, if you must know).
Since my project did not have a main() function, the linker chose that one as my “test” application. Thus, non of my tests run.

Does anyone know how I prevent this from happening? How can I tell the linker/compiler to use the Boost.Test main()?

  • 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-12T22:26:34+00:00Added an answer on June 12, 2026 at 10:26 pm

    Answering my own question, and clarifying @Tom’s answer.
    Turns out that the libpng build script I was using was not the the original shipping with libpng but one created by the OpenCV build system. The file pngtest.c was mistakenly included int the build.

    The solution to the problem was to remove pngtest.c from the libpng build script.
    The latest OpenCV version, does not include this file anymore.

    For more details see my post to Boost mailing list here and my OpenCV bug report here.

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

Sidebar

Related Questions

Using Boost.Python, is there a way to call a Python function that's been passed
#define BOOST_TEST_MODULE MemoryLeakTest #include <boost/test/unit_test.hpp> #include <iostream> using namespace std; BOOST_AUTO_TEST_CASE( MemoryLeakTest) { double*
I am developing unit test cases for an application using Boost.test libraries. There are
Using the boost::test framework, is there a way to detect if an exception (of
I'm using the Boost::Test library for unit testing, and I've in general been hacking
Using boost::phoenix::function I encountered some problems. As far as I know this lazy function
I wrote a small tcp client using boost::asio, providing the following function: typedef boost::function<void(const
I'm using boost for several C++ projects. I recently made a upgrade (1.33.1 to
Consider the following program: #include <iostream> #include boost/filesystem.hpp int main() { boost::filesystem::directory_entry d(test.txt); boost::filesystem::directory_entry
I'm using Boost Test for a long time now and I ends up having

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.