jcnelson / vdev

A device-file manager for *nix
GNU General Public License v3.0
101 stars 13 forks source link

fs/main.c is apparently C++ code. #46

Closed fbt closed 9 years ago

fbt commented 9 years ago

I've encountered a problem when building vdevfs:

In file included from /usr/include/fskit/fskit.h:25:0,
             from fs.h:32,
             from main.h:26,
             from main.c:22:
/usr/include/fskit/common.h:63:20: fatal error: iostream: No such file or directory

But if I rename fs/main.c into fs/main.cpp, it works.

Basically I've googled similar problems and tried something blindly, and it worked. Judging by what other people have encoutered, your main.c contains C++ code, which would obviously cause problems if we try to build it with gcc. If that is correct, I would propose renaming it into main.cpp.

jcnelson commented 9 years ago

Hi @fbt,

Very recently I finished porting libfskit to C. I think your libfskit install is out of date, since they're #include-ing C++ headers.

I'm sorry about the confusion. Very soon I'm going to create a 0.1 release branch for libfskit and libpstat that will each have stable APIs, so this class of bugs won't happen often.

fbt commented 9 years ago

Yep, my bad. I had severely outdated versions of fskit and libpstat. After updating, though:

acl.c: In function ‘vdev_acl_run_predicate’:
acl.c:815:41: error: dereferencing pointer to incomplete type ‘struct pstat’
sprintf(env_buf[2], "VDEV_PID=%u", ps->pid );
                                     ^
jcnelson commented 9 years ago

My bad. I hadn't sync'ed vdevfs with the external libpstat and libfskit APIs. I just pushed a fix to all three projects--to enable g++ to find libfskit and libpstat symbols, and to bring vdevfs up to speed.

fbt commented 9 years ago

Builds now. Nice!

jcnelson commented 9 years ago

Glad to hear it! Closing the issue...