Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std.ch on first PRG #152

Closed
JoseQuintas opened this issue Apr 20, 2017 · 5 comments
Closed

std.ch on first PRG #152

JoseQuintas opened this issue Apr 20, 2017 · 5 comments

Comments

@JoseQuintas
Copy link

JoseQuintas commented Apr 20, 2017

demo.prg

#include "std.ch"
FUNCTION MAIN
RETURN Nil

hhtml.prg

#include "hbclass.ch"
CREATE CLASS HHtml
   DATA oParent
ENDCLASS
d:\temp\test>hbmk2 demo hhtml
hbmk2: Processing environment options: -comp=mingw
Harbour 3.2.0dev (r1704151935)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'demo.prg'...
Lines 833, Functions/Procedures 1
Generating C source output to 'c:\temp\hbmk_vasrbp.dir\demo.c'... Done.
Compiling 'hhtml.prg'...
Lines 742, Functions/Procedures 1
Generating C source output to 'c:\temp\hbmk_vasrbp.dir\hhtml.c'... Done.
c:/temp/hbmk_vasrbp.dir/hhtml.o:hhtml.c:(.data+0x48): undefined reference to `HB_FUN_HB_SYMBOL_UNUSED'
collect2.exe: error: ld returned 1 exit status
hbmk2: Error: Running linker. 1
d:\temp\hb32\comp\mingw\bin\gcc.exe c:/temp/hbmk_vasrbp.dir/demo.o c:/temp/hbmk_vasrbp.dir/hhtml.o c:/temp/hbmk_vasrbp.dir/hbmk_wrvi3u.o    -Wl,--nxcompat -Wl,--dynamicbase -mconsole -Wl,--start-group -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainstd -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib   -Wl,--end-group -odemo.exe  -Ld:/temp/hb32/lib/win/mingw

hbmk2: Error: Referenced, missing, but unknown function(s): HB_SYMBOL_UNUSED()
d:\temp\test>hbmk2 hhtml demo
hbmk2: Processing environment options: -comp=mingw
Harbour 3.2.0dev (r1704151935)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'hhtml.prg'...
Lines 742, Functions/Procedures 1
Generating C source output to 'c:\temp\hbmk_0qps62.dir\hhtml.c'... Done.
Compiling 'demo.prg'...
Lines 833, Functions/Procedures 1
Generating C source output to 'c:\temp\hbmk_0qps62.dir\demo.c'... Done.

https://github.com/vszakats/harbour-core/issues/291

@vszakats
Copy link
Member

The example can be further minimised using this demo.prg:

#define HB_SYMBOL_UNUSED( symbol )  ( ( symbol ) )

PROCEDURE Main()
   RETURN

@druzus
Copy link
Contributor

druzus commented Apr 20, 2017 via email

@vszakats
Copy link
Member

Przemek, would you mind describing what this behaviour does?

It seems that redefining a standard rule causes that symbol to be undefined in subsequent sources, but that feels strange so I'm assuming the real explanation must be something else.

@druzus
Copy link
Contributor

druzus commented Apr 20, 2017 via email

@vszakats
Copy link
Member

Thanks Przemek, I didn't know. My conclusion is that it's best not to explicitly #include std.ch, nor to override built-in macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants