Please help me with my simple application here. I have tried three versions of mingw64's g++ and each has compiled the code fine into app.exe but gives each one when executed consistently gave this error:
app.exe - Entry Point Not Found
The procedure entry point
_ZNSt7__cxx1112basic_stringlcSt11char_traitslcESalcEEC1EPKcRKS3_
could not be located in the dynamic link library
C:\cpp\HelloObject\app.exe.
Here is the code for my application.
tree.h:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef TREE_H
#define TREE_H
#include <string>
class Tree
{
std::string species;
int age;
public:
void setAge(int);
void setSpecies(std::string);
int getAge(void);
std::string getSpecies(void);
};
#endif
#include "tree.h"
#include <iostream>
int main()
{
int option(0);
Tree yardtree;
yardtree.setSpecies("Maple");
yardtree.setAge(25);
std::cout << "What would you like to know?" << std::endl;
std::cout << "(1) The species of my tree" << std::endl;
std::cout << "(2) The age of my tree" << std::endl;
std::cout << "Your selection: ";
std::cin >> option;
if ( option == 1 )
std::cout << "The species is " << yardtree.getSpecies() << std::endl;
elseif ( option == 2 )
std::cout << "The age is " << yardtree.getAge() << std::endl;
elsereturn 1;
return 0;
}
In case you are wondering here are the commands I used in the command prompt:
g++ -c main.cpp tree.cpp
g++ -o app.exe main.o tree.o
app.exe
It looks like you are building your application as a dynamic link library rather than a binary executable. How are you compiling and linking your project?