Page 1 of 1

Dev-Cpp

PostPosted: Mon Aug 08, 2016 10:27 pm
by Hellhound
I am trying to use ForexConnect API with Dev-cpp.

I have added the include and lib directories to the compiler directories but the compiler give me error:

C:\Program Files\Candleworks\ForexConnectAPIx64\bin\FXApp1.o FXApp1.cpp:(.text+0x3d): undefined reference to `__imp__ZN13CO2GTransport13createSessionEv'

So can anyone help me with this?

Re: Dev-Cpp

PostPosted: Tue Aug 09, 2016 5:46 am
by Julia CJ
Hi Hellhound,

In order investigate this problem, please sent the project with existing issue at my e-mail: ycherepanova@gehtsoft.com.

Re: Dev-Cpp

PostPosted: Tue Aug 09, 2016 6:48 am
by Hellhound
Thank you for replying!

I have only downloaded the Dev-cpp on this machine today, started a new window application and done the following things in around 20 minutes: (So I hope I can avoid senting you the files to save some time)

1) Under tool, compiler options, library tab, I added the folder with the ForexConnect.lib file
2) Under tool, compiler options, c include tab, I added the include folder
3) Add the include line "#include <ForexConnect.h>" to the main.cpp generated by the IDE, (Dev-cpp
do not use the stdafx.h file)
4) Add a line of code to the program: IO2GSession *pSession = CO2GTransport::createSession();
inside the main window procedure, under the message WM_CREATE

Do you have any ideas why the program is not compiling? I learned from StackOverflow that undefined reference error arises because the compiler cannot find the implementation of the function, because that I am new to those DLL programming, I can't figure out what's going on...

Re: Dev-Cpp

PostPosted: Wed Aug 10, 2016 8:08 am
by Julia CJ
Hi Hellhound,

Probably, you use Win 32 platform in your project. ForexConnect applies x64. You need to use x32 version of ForexConnect or to compile the project as x64.

Re: Dev-Cpp

PostPosted: Wed Aug 10, 2016 10:15 am
by Hellhound
I have uninstalled the 64 bit version and reinstalled the 32 bit version. The same error still comes up.

The .h file do have the function declaration, but the error comes up is about a function with a different name which seems to be some kind of generated internal name.

How about Java? can I use Java SE with the API jar file?

Re: Dev-Cpp

PostPosted: Fri Aug 12, 2016 2:00 am
by Julia CJ
Hi Hellhound,

Yes, try to use Java. It should work with it.