Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: fabietto0102 on May 31, 2011, 06:04:06 pm

Title: C::B 10.05 MinGW on WinXP SP3 + Excel DLL
Post by: fabietto0102 on May 31, 2011, 06:04:06 pm
Hello,

I installed C::B 10.05 with the GCC compiler and GDB debugger from MinGW on a WinXP SP3 machine. My intention is to build an Excel DLL using C::B instead of MS Visual Studio.

I run through the project wizard, I selected DLL and I compiled the given example someFunction (without any code of mine). Unfortunately, I get #VALUE! in Excel. I followed the instruction here http://forums.codeblocks.org/index.php/topic,7041.0.html , but no luck, besides, they are 4 years old.

I was able to use a very simple DLL written and compiled with VisualStudio, but can't get it to work with C::B
main.cpp:
double __stdcall Csquare(double &arg){return (arg*arg);}
main.def:
LIBRARY FabVB
 EXPORTS
  Csquare

Any help available, please? I struggle doing the linking, even though I added -Wl,--add-stdcall-alias to the Other linker option. I tried to run the dependencywalker but nothing seems wrong to me.

Also, the Csquare method could be a good example to keep in the wiki for C::B newbee like me or as a project example for future releases of C::B.

Thank you
Fabio
Title: Re: C::B 10.05 MinGW on WinXP SP3 + Excel DLL
Post by: fabietto0102 on June 02, 2011, 01:18:18 pm
Any idea please?  :(
Title: Re: C::B 10.05 MinGW on WinXP SP3 + Excel DLL
Post by: oBFusCATed on June 02, 2011, 02:04:45 pm
I guess it will be very hard to develop a DLL for Excel using Mingw.
Have you tried to use VC++ compiler?