Help me using ginput library in C++ Visual Studio

Talk about anything concerning the source code.
Post Reply
cataz
Posts: 14
Joined: Thu Dec 05, 2019 12:04 pm

Help me using ginput library in C++ Visual Studio

Post by cataz »

Hi all :)

Thx to the wiki (https://gimx.fr/wiki/index.php?title=De ... on_Windows) I build gimx on my local machine. I was able to change functions mainly for debugging purposes to understand how gimx works. I could build and use gimx.exe successfully.

The next step for me is to use some of the gimx libraries (https://gimx.fr/wiki/index.php?title=Gasync) in a simple c++ demo program. I included GIMX\shared and SDL\include as additional include paths and set preprocessor defintions for WIN32. My source code is just what is demonstrated in ginput_test.c file.

In the visual studio editor my source looks good. However when I try to build a release I get errors from the compiler:

Code: Select all

1>c:\users\coder\git\gimx\shared\gimxcommon\test\handlers.c(25): error C2146: syntax error: missing ')' before identifier '__attribute__'
1>git\gimx\shared\gimxcommon\test\handlers.c(25): error C3646: '__attribute__': unknown override specifier
1>git\gimx\shared\gimxcommon\test\handlers.c(25): error C2059: syntax error: '('
1>git\gimx\shared\gimxcommon\test\handlers.c(25): error C2059: syntax error: ')'
1>git\gimx\shared\gimxcommon\test\handlers.c(25): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>git\gimx\shared\gimxcommon\test\handlers.c(27): error C2059: syntax error: ';'
1>git\gimx\shared\gimxcommon\test\handlers.c(28): error C2059: syntax error: '}'
1>gimx\shared\gimxcommon\test\handlers.c(28): error C2143: syntax error: missing ';' before '}'
1>git\gimx\shared\gimxcommon\test\handlers.c(31): error C2143: syntax error: missing ';' before '{'
For me it looks like visual studio tries to compile the gimx library as well. Why doesn't it take the gimx as a library and instead tries to compile it?
How can I build gimx so I can use it as a library for my own app?

My c++ code is avaiable here: https://pastebin.com/UFnCSs62

Please guide me :oops:
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Help me using ginput library in C++ Visual Studio

Post by Matlo »

Hi,

Sadly the source code is not intended to work with another compiler than GCC, and I have no intention to change this as this is a lot of work for very little benefit. The source code uses a lot of GCC's C extensions which are causing the compilation errors.
GIMX creator
cataz
Posts: 14
Joined: Thu Dec 05, 2019 12:04 pm

Re: Help me using ginput library in C++ Visual Studio

Post by cataz »

I see matlo, thx for the reply! I started implementing my own solution based on gimx concepts. I can't thank you enough - gimx guides and simpliefies so many things for me.

At this stage I have some mouse movement jerkiness I'm working on. I will open a new topic if I can't solve it myself. Once again thank you so much ❤️
Post Reply