Sign in to follow this  
dagoston93

How to create C gauge project in Visual Studio 2015?

Recommended Posts

Hi,

I am new to FSX programming.

I have been working on a project, I am learning programming managed SimConnect clients, and now I have to learn creating C gauges also.

I am not beginner in programming, but am not professional either.

I have found Dai Griffin's sd2gau tutorial about C gauges.

I started to understand, how it works, but i have one big problem.

I cannot setup Visual Studio for a new C gauge, and i cannot find any information about that neither in the tutorial, nor on MSDN...

(nor google gives a result....)

I loaded the SDK example in VS2015, and could figure it out that it is a makefile project...

It could be built successfully and I got the SDK.dll.(I got an error message but the dll is generated).

I tried to create the DCvoltmeter project from the sd2gau examples, and compile it just to test.

So I created a new c++ makefile project.

I created each file in VS and copied the contents from the DCvolts project.

Then I made sure all settings in this project match the settings in the SDK example's settings.

(right click on project name then clicked properties and checked all tabs)

But when I try to compile DCvolts, I get the error message: "Unable to start program: C:\User\...\DCVolts.exe. The system cannot find the file spcified.".

When I compile the sdk example i get something like this, but with dll extension, and I get the .dll file.

Here I don't even get the an .exe file.

I checked the NMake tab of the properties page and here the output is set in the sdk example to SDK.exe, but for some reason, it compiles as SDK.dll.

My next suspect was the file 'makefile' without any extensions.

I read the contents of it. This was the only place which referred to a .dll extension. I thought it was supposed to be an autogenerated file, but nothing was created in DCvolts project, so I tried to create an own

makefile, but the same thing happened, I got the error message with .exe extension and nothing was created.

I also tried to change the extension on the properties page, but same thing...

Please help me, because my project is stuck...

Thank you very much in advance for any help,

Agoston

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

There is a far, far easier way to use Visual Studio for coding both single "gauge" and "multi-gauge" projects. No 'makefile' BS to deal with. Once set up, you compile your gauge project directly from VS. Also, you can even run a 'debug' session provided you have FSX/P3D installed on the same computer. There is a way to 'debug' through a network, but since my main test sim computer is in another room entirely, it's not practical for my needs. :Nerd:

Although this was originally written with MSVC++ .NET 2003 in mind, the essentials remain the same for Visual Studio as well.

http://www.flightsim.com/vbfs/showthread.php?152231-MSVC-NET-2003-IDE-Setup

The mini-tutorial continues by describing how to expand the example to a true multi-gauge project here:

http://www.flightsim.com/vbfs/showthread.php?152233-Converting-the-Gauge-Project-to-Multi-Gauge-Format

I also highly recommend this resource, as this is where some of the best C++ sim programmers hang out:

http://www.fsdeveloper.com/forum/forums/gauges.64/

Share this post


Link to post
Share on other sites

Hi,

thank you very much for the answer.

I tried that tutorial, I set up everything as he did in the example.

I am still trying to get the DCvolts example from sd2gau35.

I excluded the .c file from the project as i the tut, I have everything in the inc folder that is needed, the rc file is also pointing to the correct place of the bitmaps, and I also did the setup in the properties windows.

But I get 128 compile errors... Thinks like: identifier class undefined, and a loads of syntax errors.

I googled a couple of times, and then figured out I should try to rename the .c files to .cpp.

I am not getting those syntax errors anymore.

I am getting instead only 76 errors.

Like: "Error C2065 'fuel_level_leftaux': undeclared identifier" in the fs_functions.h.

This is an include file i got with the sd2gau35 tut.

If I uncomment the: #include "inc\dragonflight.h" line in the DCvolts.cpp, (the dragonflight.h includes the fs_functions.h), I get only two errors...

The folowwings ones:

 

- a value type of "MODULE_VAR_CB *" cannot be used to initialize an entity of type "PNEEDLE_UPDATE_CALLBACK"

- 'initializing': cannot convert from 'MODULE_VAR_CB' (_stdcall*)' to 'PNEEDLE_UPDATE_CALLBACK'

 

Might there be a problem in the source code provided with the 'bible'?

Or have I done something wrong?

 

The first line of fs_functions.h originally was:

#include fsxgauges_sp2.h
Instead of:
#include "fsxgauges_sp2.h"
 
I corrected this...
When I change it back to the original I only have 24 errors,
the first is:
expected a filename
then errors like: identifier 'fuel_left_leftaux' is undefined...
 
I have no idea how to get this thing work...
Sometimes  during my experimenting, I got the small window mentioned yesterday, but I find nowhere DCvolts.gau, nor DCvolts.dll as it appears in the window, despite the output is set to DCvolts.gau as in the tut.
 
Thanks in advance for any help,
Agoston
 

 

 

 

 
 

 

Share this post


Link to post
Share on other sites

I have to confess that I haven't done any C++ coding in several years now, which is one reason why I so highly recommended joining/posting at FS Developer. There are many truly crackerjack C++ folks there who would be much more likely to provide guidance.

 

By the way, your gauge must have the extension of .gau or .dll. A .gau file is simply a renamed .dll (dynamic linked library) anyway.

 

You should never compile an .exe (executable) since it isn't a stand-alone program. B)

Share this post


Link to post
Share on other sites

Thank you very much :)

 

I couldn't get those examples work, but I could get my own first test gauge work,

and thanks for suggesting FSDevelopers, I have joined, and will ask if I get stuck again with my gauge :)

 

So thanks  a lot and have a nice day :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this