Here is my code
1. foo.h
#include <iostream>
using namespace std;
class myclass
{
int i;
public:
void foo(int a);
};
int func (int a);
2. foo.cpp
#include "foo.h"
int func (int a) { return a; }
void myclass::foo(int a)
{
i = func(a);
cout<<i<<"\n";
}
3. main.cpp
#include "foo.h"
int main()
{
myclass ob1;
ob1.foo(1);
return 0;
}
I tried to make .o files using llvm-g++.
![]()
then I tried to link two .o files using llvm-ld, but...
![]()
it finished like this. (showing "'main' function not found in module." message when I just run the output file)
Did I do well? Please give me the right way to link them.
1. foo.h
#include <iostream>
using namespace std;
class myclass
{
int i;
public:
void foo(int a);
};
int func (int a);
2. foo.cpp
#include "foo.h"
int func (int a) { return a; }
void myclass::foo(int a)
{
i = func(a);
cout<<i<<"\n";
}
3. main.cpp
#include "foo.h"
int main()
{
myclass ob1;
ob1.foo(1);
return 0;
}
I tried to make .o files using llvm-g++.
then I tried to link two .o files using llvm-ld, but...
it finished like this. (showing "'main' function not found in module." message when I just run the output file)
Did I do well? Please give me the right way to link them.
_______________________________________________ klee-dev mailing list [email protected] https://mailman.ic.ac.uk/mailman/listinfo/klee-dev
