Hi~
I’m asking about cross linking with g++ objective file and pgcc objective file.
The sample is too simple.
main.cpp :
#include <fun.h>
int main(){
fun(1,2);
}
fun.c:
void fun(int a, int b){
int c;
c=a+b;
}
fun.h:
#include <stdio.h>
void fun(int,int);
Now, first, I compiled main.cpp like as follows:
g++ -c main.cpp
Second, I compiled fun.c:
pgcc -acc -ta=nvidia -c fun.c:
After that, I tried to link together by g++
g++ -o aaa main.o fun.o
But, there are error
main.cpp(.text+0xf) : undefined reference to ‘fun(int,int)’
collect2:ld returned 1 exit status
These files are compiled well by using g++ alone.
How do I solve that kinds of problem?