Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Using .cpp files for a module

Featured Replies

Hi,I'm trying to convert my FSConnect module from C to C++ so I can take advantage of the object oriented features of the language, but when I change the file extension to cpp, I get compile errors: error C2086: 'Linkage' : redefinition error C2086: 'ImportTable' : redefinitionIn a way, it makes sense, because those structures are declared twice. Makes me wonder how it worked in straight C.So I combined the declarations like this:__declspec(dllexport) GAUGES Linkage = { 0x0000520F, module_init, module_deinit, 0, 0, 0x0900, 0, 0 }; I did something similar for ImportTable.This compiles, but FS crashes on startup.Anybody tried this and got it to work?Thanks,Russ Dirks

Try something like:#ifndef EXTERN_C#ifdef __cplusplus #define EXTERN_C extern "C"#else #define EXTERN_C extern#endif#endif....EXTERN_C DECLSPEC_EXPORT GAUGESIMPORT ImportTable;EXTERN_C DECLSPEC_EXPORT GAUGESLINKAGE Linkage;Your code might look different, the point is to introduce an 'extern "C" ' declaration for C++ and 'extern' for C.Arne Bartels

  • Author

Thank you a thousand times! :-)Works like a charm. Russ

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.