Commit 637072ac authored by Richard Benson's avatar Richard Benson

c works fine

parent cadff17e
OBJS=so.o so_imp.o
INCS=so.hpp
INCS=so.h
SOLIB=so.so
all: so_imp
......@@ -8,10 +8,10 @@ all: so_imp
$(OBJS): $(INCS)
$(SOLIB): so.o
$(CXX) $(CXXFLAGS) -shared -o $@ $^
$(CC) $(CFLAGS) -shared -o $@ $^
so_imp: so_imp.o $(SOLIB)
$(CXX) $(CXXFLAGS) -o $@ $^
$(CC) $(CFLAGS) -o $@ $^
test: all
LD_LIBRARY_PATH=. ./so_imp
......
#include "so.hpp"
#include "so.h"
void hello () {
printf ("hello\n");
......
#include <stdio.h>
extern void hello ();
#include <cstdio>
extern "C" {
void hello ();
}
#include "so.hpp"
#include "so.h"
int main () {
hello ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment