Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

ANT_DLL.dll ANT_Init() fails

Rank

Total Posts: 5

Joined 2014-04-18

PM

I'm trying examples from package: ANT_Windows_Library_Package_v3.2_1
IDE: MS Visual C++ 2010 Express
USB Stick: ANT USB-m
ANT Lib ver: ALU3.200
WIndows: 7 64bit

When I try DEMO_LIB everything works fine.

When I try DEMO_DLL only ANT_Load() and ANT_LibVersionSupport() works ok, but ANT_Init(0,57600) always fails.
I have same settings (defines) as it is in DEMO_LIB. All DLLs are part of exe directory.

I'm only occasional C++ programmer so maybe I'm something missing what could be wrong with DLL version of example.

     
Rank

Total Posts: 2

Joined 2009-07-20

PM

I'm having the same problem having moved from an old Borland (Embarcadero 2010) to a newer compiler (Embarcadero XE5). ANT_Init returns 0, but this gives no clue as to why it fails when it succeeds using the previous setup.      
Rank

Total Posts: 5

Joined 2014-04-18

PM

I tried DLL within Embarcadero XE3, there I had ANT_Init() problem.
So I have installed MS VC++ Express2010 and compiled original project from Library Package example with same result for ANT_Init().

If DLL from package v3.21 worked for whatever IDE, so problem could be with some compiler/linker options? Even if I see no errors or warning after build.

I would also try older version of that Library Package, but I can't find it anywhere.      
Rank

Total Posts: 2

Joined 2009-07-20

PM

Just in case anyone else has a similar problem...

I am migrating from an early version of Embarcadero (2010) to XE5. I suspect this issue applies to XE3 on.

The ANT DLL loaded OK, the ANT_Init was loaded ok with DYNAMIC_LIB_LOAD_PROC as I could see the parameter list. ANT_Init returned FALSE/0.

In the Project->Options->C++ Compiler->Compatability:General, tick the Backwards Compatabililty option to true. It's that easy (once you trawled through every other option!).

Good luck      
Rank

Total Posts: 5

Joined 2014-04-18

PM

Hi again,

I still have no luck with ANT_DLL.dll to make it work under Windows 7-64bit and with stick ANT-USBm.
Can someone post here compiled version of that dll which was tested with USBm stick under 64bit WIN?

Thanks in advance.      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

I'm successfully using the distributed DLL under W'7 64bit - however in an app compiled for 32 bit.
So if you don't really need a 64 bit app (the only compelling reason besides larger address space might be availability of 3rd party libs that you need to use), you can try and fall back to a 32 bit app.

Cheers,
OMB      
Rank

Total Posts: 1

Joined 2015-05-11

PM

Hi:

I am using Mingw32 to compile the DEMO_DLL example. Compilation worked smooth but ANT_Init() always returns 0. SimulANT+ detects the dongle correctly so it is not a hardware issue.
Anyone used Mingw32 to compile the demo application?

Thanks,

Harald      
Rank

Total Posts: 13

Joined 2015-03-24

PM

I don't know if this helps anyone but I ran into this same thing today and after recompiling all the ANT lib's so I could get into them with the debugger (vis studio 2013) I found that the ant_init in the library actually accepts 4 parameters though the last two are defaulted to zero's. Internally if they are not zero you will get FALSE returned by ant_init. The problem is (at least with my compiler) that the defaults are not being honored. Instead they're just garbage. If you stuff the right values in with the debugger the init call works. So if anyone knows a generic way around this please publish it... unfortunately I can't find an option similar to "Backwards Compatabililty" mentioned above in vis studio. Thx      
RankRankRankRank

Total Posts: 313

Joined 2011-09-12

PM

Just in case anyone finds this in the future, the ANT_Init header definition error is now fixed in the new v.3.5 SDKs https://www.thisisant.com/forum/viewthread/6468/      

Signature

Dynastream Developer