• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Can't find entry point in #13

Started by Paul Breen, January 18, 2010, 05:19:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Paul Breen

Hello:
In number 13 we make a dll in cpp then call a function in from basic.

I used the code blocks wizard to compile the dll from your code and the basic code compiled as well.
I made no changes the code, but a dialog that says "Can not find the entry point Print in PROGEX13.DLL"

It seems the dll is loaded but something is wrong. Have you tried this one with Code Blocks?

PB

LATER:
I have found that using the same source file, the dll made by code blocks has the problem above but the dll
made by Visual C++ 6.0 works just fine, debug and release.
Funny detail, the VC dll is much smaller than the code blocks dll in debug version(711 vs 211 kb) and much larger in the release version (48 vs 6 kb)
How can you get such a large file with essentially just one line of code?

This is kind of fun working through, Fred. I guess you know you are getting old when this is how you
spend your leisure time.
I like the ease of installation for code blocks but maybe visual c++ is
worth the extra bs (it works). I sure like the F1 context help, it works very well for everything I have tried, including the win32 help.

thanks,
PB




Frederick J. Harris

I'll check it out tomorrow Paul.  Whoops, it is tomorrow (12:02)!  Well, later this morning!

Frederick J. Harris

#2
I just compiled the ProgEx13 dll project with CodeBlocks and ended up with ProgEx13.dll.  I put the PowerBASIC created dllHost.exe in the same directory with it, created a shortcut to dllHost.exe and sent it to my desktop, and started it that way.  Worked 1st time.  So I don't know why you are having problems Paul.  When I created the C++ dll with CodeBlocks I started with a 'Dll Project'.  There is always a bunch of boilerplate code it supplies in a Main.cpp and Main.h file, but I usually delete that and use my own, especially for something as simple as this.  So I just removed the *.h file.

Also, I'm not sure how you are getting such massive executables.  With CodeBlocks I ended up with this for the dll...

5.50 KB (5,632 bytes)

With any development environment I use I always go into the build options and set the compiler switches to strip all symbols from the executable and compile for small size ( -Os  with GNU ).  That's how I ended up with the 5.5 K.  Oh, I just looked again; you got the 6k dll in the Release version too.  I know with Visual C++ 6 from Microsoft you have to be careful when you set up the project that you don't include MFC support ( unless you want it ) because that really bloats up the executables.  That's a tricky issue with that version of VC++ because if you don't include MFC support you don't have any C++ String Class.  In later versions of the development suite they included support for the C++ standard String Class so you can have at least a real String Class in projects that don't link with MFC code.  That issue really 'threw' me for a long time and is the reason I spent a whole lot of time creating my own String class, because I didn't want to use MFC in my C++ work.

I'm glad you are enjoying the little programs.  I enjoyed making them.  Best way to learn I think is with little programs that just explore one concept at a time.

Paul Breen

Ok, now.

I did exactly the same thing, starting with a new download and install of codeblocks 'package' binary install with the mingw compiler. Could have been a download bit dropped somewhere. Debug went from 711 to 17KB. I just changed the filename of the dll instead of using the right project name (I forgot) but everything is kopesetic.

PB