Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22130

for c/cpp include path by adding the path to system file and run

$
0
0

A file called test.cpp in ~/test code is

#include <stdio.h>
#include "add.h" 
int main(){
    printf("%d\n",add(1,2));
}

file add.h is in ~/test/1, which is just a subdirctory

code is

int add(int a, int b){return a+b;}

then i use export

export PATH=$PATH:~/test/1

enter image description here

Is there any way to fix that?

not using #include "1/test"

any help is much appreciated


Viewing all articles
Browse latest Browse all 22130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>