Harbour 3.0 / MSVC DLL32 error

Harbour 3.0 / MSVC DLL32 error

Postby TimStone » Mon Nov 28, 2011 11:19 pm

I'm back on the project of trying to build my application with MSVC and Harbour 3.0.

The following code:

// static unsigned int I2PDF_SetDPI(unsigned int dpi);
DLL32 STATIC FUNCTION IPSetDpi( nDpi AS LONG ) AS LONG PASCAL FROM "I2PDF_SetDPI" LIB [hImLib] // "Image2PDF.dll"

draws a "Syntax error at STATIC"

Daniel suggested linking in legacym.lib, but that doesn't help. Apparently the preprocessor in Harbour 3.0 can't handle this syntax.

Does anyone have a workaround ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour 3.0 / MSVC DLL32 error

Postby Daniel Garcia-Gil » Mon Nov 28, 2011 11:43 pm

Tim

your problem is compiling not linking...

inside folder include of harbour, there are "dll.ch", it causes a conflict with "dll.ch" from fivewin
try any solution below:
1) change the include order in compile time OR
2) rename dll.ch from harbour OR
3) copy and paste the content file in the other one
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Harbour 3.0 / MSVC DLL32 error

Postby TimStone » Tue Nov 29, 2011 2:25 am

Thank you. That resolved the DLL32 problem, at least for compiling.

Now, do you have a list of .lib files that should be linked in with the MSVC linker ? Now I have a large number of missing externals which include menu, print, and bar functions among others.

Right now I link the following libraries:

LIBS1 = FiveH32.lib FiveHC32.lib legacym.lib
LIBS2 = hbrtl.lib hbvm.lib gtgui.lib hblang.lib hbmacro.lib hbrdd.lib rddntx.lib rddcdx.lib rddfpt.lib hbsix.lib rddads.lib ace32.lib hbdebug.lib
LIBS3 = hbcommon.lib hbpp.lib hbcpage.lib hbwin.lib hbct.lib xhb.lib hbpcre.lib libeay32.lib ssleay32.lib psapi.lib
LIBS4 = version.lib oledlg.lib version.lib kernel32.lib user32.lib winmm.lib gdi32.lib winspool.lib comctl32.lib comdlg32.lib
LIBS5 = advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib iphlpapi.lib mpr.lib wsock32.lib msimg32.lib
LIBS = $(LIBS1) $(LIBS2) $(LIBS3) $(LIBS4) $(LIBS5)
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour 3.0 / MSVC DLL32 error

Postby Daniel Garcia-Gil » Tue Nov 29, 2011 4:47 am

Hello

in a last work to a customer, i did with this make file

Code: Select all  Expand view

#change these paths as needed
.path.OBJ = .\obj
.path.PRG = .\source\prg;.\
.path.CH  = $(FWDIR)\include;$(HBDIR)\include
.path.H   = .\include
.path.C   = .\source\c
.path.CPP = .\source\c
.path.rc  = .\res

#important: Use Uppercase for filenames extensions, in the next two rules!
HBDIR=c:\$(PRGCOM)
HBLIB=$(HBDIR)\lib\win\msvc
FWLIB=$(FWDIR)\lib

PRG =        \
demofgr.PRG  \

PROJECT    : $(APPNAME).exe

$(APPNAME).exe  : $(PRG:.PRG=.OBJ) $(CPP:.CPP=.OBJ)
   echo off
   echo obj\demofgr.obj         > msvc.tmp  
   echo $(FWLIB)\FiveHC32.lib  >> msvc.tmp
   echo $(FWLIB)\FiveH32.lib   >> msvc.tmp
   echo $(HBLIB)\hbrtl.lib     >> msvc.tmp
   echo $(HBLIB)\hbvm.lib      >> msvc.tmp
   echo $(HBLIB)\gtgui.lib     >> msvc.tmp
   echo $(HBLIB)\gtwin.lib     >> msvc.tmp  
   echo $(HBLIB)\hblang.lib    >> msvc.tmp
   echo $(HBLIB)\hbmacro.lib   >> msvc.tmp
   echo $(HBLIB)\hbrdd.lib     >> msvc.tmp
   echo $(HBLIB)\rddntx.lib    >> msvc.tmp
   echo $(HBLIB)\rddcdx.lib    >> msvc.tmp
   echo $(HBLIB)\rddfpt.lib    >> msvc.tmp
   echo $(HBLIB)\hbsix.lib     >> msvc.tmp
   echo $(HBLIB)\hbdebug.lib   >> msvc.tmp
   echo $(HBLIB)\hbcommon.lib  >> msvc.tmp
   echo $(HBLIB)\hbpp.lib      >> msvc.tmp
   echo $(HBLIB)\hbwin.lib     >> msvc.tmp
   echo $(HBLIB)\hbcpage.lib   >> msvc.tmp
   echo $(HBLIB)\hbct.lib      >> msvc.tmp
   echo $(HBLIB)\xhb.lib       >> msvc.tmp
   echo $(HBLIB)\hbpcre.lib    >> msvc.tmp  
   echo $(HBLIB)\png.lib       >> msvc.tmp  
   echo $(HBLIB)\hbzlib.lib    >> msvc.tmp  
   
   echo $(VCDIR)\lib\kernel32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\user32.lib    >> msvc.tmp
   echo $(VCDIR)\lib\gdi32.lib     >> msvc.tmp
   echo $(VCDIR)\lib\winspool.lib  >> msvc.tmp
   echo $(VCDIR)\lib\comctl32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\comdlg32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\advapi32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\shell32.lib   >> msvc.tmp
   echo $(VCDIR)\lib\ole32.lib     >> msvc.tmp
   echo $(VCDIR)\lib\oleaut32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\uuid.lib      >> msvc.tmp
   echo $(VCDIR)\lib\odbc32.lib    >> msvc.tmp
   echo $(VCDIR)\lib\odbccp32.lib  >> msvc.tmp
   echo $(VCDIR)\lib\iphlpapi.lib  >> msvc.tmp
   echo $(VCDIR)\lib\mpr.lib       >> msvc.tmp
   echo $(VCDIR)\lib\version.lib   >> msvc.tmp
   echo $(VCDIR)\lib\wsock32.lib   >> msvc.tmp
   echo $(VCDIR)\lib\psapi.lib   >> msvc.tmp
   echo $(VCDIR)\lib\msimg32.lib   >> msvc.tmp
   echo $(VCDIR)\lib\libcmt.lib   >> msvc.tmp
   echo $(VCDIR)\lib\oldnames.lib   >> msvc.tmp
   echo $(VCDIR)\lib\libcpmt.lib   >> msvc.tmp
   echo $(VCDIR)\lib\oledlg.lib   >> msvc.tmp

   
   echo .\res\$(APPNAME).res >> msvc.tmp
   $(VCDIR)\bin\link @msvc.tmp /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libc /OUT:$(APPNAME).exe > link.log
   del msvc.tmp

.PRG.OBJ:
  $(HBDIR)\bin\harbour $< /n /W /p /Oobj\ /i$(FWDIR)\include;$(HBDIR)\include;.\include
  $(VCDIR)\bin\cl -c -TP -W3 -GA -I$(HBDIR)\include -I$(FWDIR)\include -I.\include -I$(VCDIR)\include -Foobj\$& obj\$&.c


 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Harbour 3.0 / MSVC DLL32 error

Postby TimStone » Tue Nov 29, 2011 7:32 pm

Daniel,

You told me to add legacym.lib but your sample does not. I have it following the FiveHC32.lib and FiveH32.lib

I have check the libs and the paths. All files are present, all paths are correct, and the linker is not reporting any problem finding the libs.

I am using FWH 11.10 ( while I wait for 11.11 to be clean ). I have Visual Studio 2010 installed.

The linker is telling me it can't find many basic functions ( externals ). These include, but are not limited to, TINI, GRADIENTFILL, MENUEND, MENUADDITEM, MENUBEGIN, TBITMAP, TBAR, SHELLDEBUG, SHELLEXECUTE, TICON, TFONT, TMULTIGET, OSEND, DBGALERTT, TFOLDER, TPRINTEND, PAGEEND, PAGEBEGIN, PRINTBEGIN, TBUTTON.

I am using Ultra Edit Studio's Build configuration, but that really shouldn't make any difference. It has worked in the past.

I'm guessing there is one missing element that will fix this.

I am also using the original Harbour 3.0 release and have not installed any more recent versions.

Any input anyone can provide will be appreciated ... EXCEPT ... please don't tell me to use BCC ! That seems to be a constant reply, and my response is I'm trying to move forward, not revert to an older compiler. Antonio posted an excellent comparison of the compilers on this forum several months ago, and the most flexible for moving forward was MSVC ... so I prefer to go in that direction. Otherwise I could just stay with xHarbour and Pelles C which works fine right now.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour 3.0 / MSVC DLL32 error

Postby Antonio Linares » Tue Nov 29, 2011 8:34 pm

Tim,

We are almost done with FWH 11.11 and then I plan to help you on this :-)

Two comments that support "our" theory that MSVC is the way to go for Windows development:

1. dBase recently moved from Borland C to Microsoft C, and according to their own words:
http://www.dbase.com/
dBASE 2.70 has been built with the new Microsoft compiler in order to make dBASE more compatible with newer OS's.

thats means a lot, when we are talking about a Borland original product... :-)

2. Daniel commented me today that he upgraded to the most recent MinGW gcc version (4.6.1) and there is no way to compile a simple C module. Somehow, it seems as they broke backwards compatibility...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41410
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.0 / MSVC DLL32 error

Postby Daniel Garcia-Gil » Tue Nov 29, 2011 8:48 pm

Hello Tim

with fwh 11.10, you dont need the legacy lib
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Harbour 3.0 / MSVC DLL32 error

Postby TimStone » Tue Nov 29, 2011 10:50 pm

Daniel,

I removed legacym.lib ( which I believe you suggested when I was having problems with the DLL32 redefines ).

I still have the same problem. I will need to explore further. Its as if the linker doesn't actually include some of the harbour .dlls where these are defined although they are listed.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Harbour 3.0 / MSVC DLL32 error

Postby Daniel Garcia-Gil » Tue Nov 29, 2011 10:56 pm

Hello Tim

can you send me the template of uestudio to build with msvc ?

danielgarciagil@gmail.com

thanks
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Harbour 3.0 / MSVC DLL32 error

Postby TimStone » Tue Nov 29, 2011 11:02 pm

Sent by email
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2909
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests