This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hi, I'm writing a dissector that I've put in the plugins directory. Some of the code being called by my dissector is C++ code. The C++ code has been compiled into a library. Currently, I am calling "make" from my wireshark installation directory, which compiles foo.o with gcc and then attempts to link foo.o with my C++ library with gcc as well (to form foo.so). However, I believe I want to use g++ to link, right? Right now after I call "make", I am separately issuing a g++ link command. Is there any clever way to integrate the g++ link command into the "make" so that I don't have to link with a separate call?

Also, I'm not too familiar with shared objects. It looks like any library I link in has to be compiled with the -fPIC flag - is that right?

asked 17 Oct '11, 16:49

JVo's gravatar image

JVo
16558
accept rate: 0%

I really dont know the answer but can share some knowledge...

ifdef __cplusplus

extern "C" {

endif / __cplusplus /

This code is present in some of the header files which will allow the cplusplus code to sync up with the C.

(18 Oct '11, 01:32) Terrestrial ...

Thanks. Yes, I am using the ifdef _cplusplus extern "C" code. But if anybody can help answer either of the other questions, that would be great.

(18 Oct '11, 10:01) JVo
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×41
×19
×18
×17

question asked: 17 Oct '11, 16:49

question was seen: 3,424 times

last updated: 18 Oct '11, 10:01

p​o​w​e​r​e​d by O​S​Q​A