vs19 c++ console app LINK : warning LNK4067

I am getting below error when I want to Build and Release my app:

LINK : warning LNK4067: ambiguous entry point; selected 'mainCRTStartup'

This is how my main.cpp looks like:

1
2
3
4
5
6
7
8
#include "defClass.h"
int main()
{
    system("Color 0A");
    Core app;
    app.menuMain();
    return 0;
}


I tried couple of solutions, but none worked for this.

what's causing it?
how to solve this?
what's the right practice for setting main function of a console app?

besides, after build is complete without any error, I don't get .EXE in Release folder. There's a myAPP.exe.recipe 1KB. Here are all files:

impClass.obj
myAPP.exe.recipe
myAPP.iobj
myAPP.ipdb
myAPP.log
myAPP.obj
shell.obj
sqlite3.obj
vc142.pdb
Last edited on
What other compilation units are defined to be compiled? Does one of these also have a main() function?
Other than main.cpp, project file only consist of one header file "defClass.h" and another cpp -> "impClass.cpp" which include definition and implementation of multiple classes with many functions. And no, there are no main() function in "impClass".

If it helps. here are libraries used in header:

#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <limits>
#include <ctime>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <thread>
#include <chrono>
#include <cmath>
#include "sqlite/sqlite3.h"

#ifndef DEFCLASS_H
#define DEFCLASS_H
.
.
.
#endif //DEFCLASS_H

Meanwhile, I have zero error, warning and message during Debug except sometimes getting above mentioned error.
Last edited on
Topic archived. No new replies allowed.