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

VS2013: No External References for a new plugin

0

I've written a test plugin for Wireshark. I did the following:

  1. I followed the instructions in README.plugins
  2. I then created an Empty C++ project called foo in the Plugins folder in Solution Explorer
  3. I used Add -> Existing item to add the various files into the foo plugin folder, basically mimicking what was in the gryphon folder

This all looked fine but Visual Studio hadn't picked up the External References, and I wasn't keen to hunt down the various include files and add them manually. What to do?

This is a rhetorical question as I've figured out the fix but it's worth documenting here.

asked 08 Nov '15, 14:46

PaulOfford's gravatar image

PaulOfford
131283237
accept rate: 11%


One Answer:

0

The answer is:

  1. Open CMakeList.txt in the Wireshark base directory
  2. Edit the list of files after set(PLUGIN_SRC_DIRS to add your new plugin
  3. Save
  4. Change to the build directory
  5. Run the cmake command to create the build files
  6. Start VS using the Wiresahrk.sln in the build directory

For me, the cmake command to create the build files was:

cmake -D ENABLE_CHM_GUIDES=on -G "Visual Studio 12 Win64" ..\

The above is described in the README.plugins file but it's in the section 3.2 Permanent addition and I skipped over it because I wasn't writing a permanent addition.

Best regards...Paul

answered 08 Nov '15, 14:58

PaulOfford's gravatar image

PaulOfford
131283237
accept rate: 11%

The correct solution is to copy CMakeListsCustom.txt.example in the root of the source tree to CMakeListsCustom.txt and edit as required.

The reason for this is that modifying the main CMakeLists.txt will change a git controlled file, so you'll always have to manage a merge when you update from the Wireshark repository. Using the custom file avoids this.

There is provision for similar CMakeListsCustom.txt files in the epan and ui\gtk directories.

(09 Nov '15, 02:51) grahamb ♦

Thanks Graham. That sounds a much better solution.

(09 Nov '15, 03:08) PaulOfford