Visual Studio: mylib.lib is not a valid win32 application

thebluetropics 1,046 Reputation points
2022-10-12T09:45:39.51+00:00

I have a solution with two projects: mylib and mylib-test

mylib is a Static Library project.
mylib-test is a Desktop Application project.

mylib-test reference the mylib project.
mylib-test also include the mylib project directory, in order to include mylib.h inside mylib project.

The build order is: mylib, mylib-test
There is correct build order.

However, I got this when I try to run the mylib-test:

249692-image.png

Of course, tried exclude mylib from build. But still didnt work.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,888 questions
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,523 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,637 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
967 questions
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 43,381 Reputation points
    2022-10-12T10:00:01.317+00:00

    Set your Windows desktop application project, mylib-test as the solution startup project.

    For example, in the property page for the solution -

    249712-startup.png

    0 comments No comments

0 additional answers

Sort by: Most helpful