I am not really sure what is going on here (bug?), however, I suppose some sort of error message is required to be produced after linker error.
My case is here: viewtopic.php?f=12&p=544084#p544084
Everything works with dynamic library and related PB's functions, however, this code doesn't compile (only if I remove line 16).
Code: Select all
c:\Users\x\Desktop>"c:\Program Files\PureBasic\Compilers\pbcompiler.exe" main2.pb -t
******************************************
PureBasic 5.71 LTS (Windows - x64)
******************************************
Compiling main2.pb
Loading external libraries...
Starting compilation...
17 lines processed.
Creating and launching executable.
Error: Linker
c:\Users\x\Desktop>Code: Select all
EnableExplicit
Import "websocket.lib"
NewWebSocketClientConnection.i (scheme.i, host.i, path.i, echoMessage.i)
EndImport
Define *scheme, *host, *path, *echoMessage, *returnEchoMessage
*scheme = AllocateMemory(1024)
*host= AllocateMemory(1024)
*path = AllocateMemory(1024)
*echoMessage = AllocateMemory(1024)
PokeS(*scheme, "wss", -1, #PB_UTF8)
PokeS(*host, "demos.kaazing.com", -1, #PB_UTF8) ;echo.websocket.org
PokeS(*path, "/echo", -1, #PB_UTF8)
PokeS(*echoMessage, "Hello from PureBasic through Secure Web Socket feat. Golang :)", -1, #PB_UTF8)
*returnEchoMessage = NewWebSocketClientConnection(*scheme, *host, *path, *echoMessage)
MessageRequester("Response", PeekS(*returnEchoMessage, -1, #PB_UTF8))Code: Select all
go.o:
000000000022ea90 T _cgoexp_ca066297f1e0_NewWebSocketClientConnection
000000000022eaf0 T main._cgoexpwrap_ca066297f1e0_NewWebSocketClientConnection
000000000022f030 T main._cgoexpwrap_ca066297f1e0_NewWebSocketClientConnection.func1
00000000000de4c0 R main._cgoexpwrap_ca066297f1e0_NewWebSocketClientConnection.stkobj
000000000022ec40 T main.NewWebSocketClientConnection
000000000022f090 T main.NewWebSocketClientConnection.func1
00000000000de480 R main.NewWebSocketClientConnection.stkobj
0000000000000000 r .rdata$.refptr._cgoexp_ca066297f1e0_NewWebSocketClientConnection
0000000000000000 R .refptr._cgoexp_ca066297f1e0_NewWebSocketClientConnection
0000000000000070 T _cgo_ca066297f1e0_Cfunc__Cmalloc
U _cgo_release_context
U _cgo_wait_runtime_init_done
U _cgoexp_ca066297f1e0_NewWebSocketClientConnection
U crosscall2
U malloc
0000000000000000 T NewWebSocketClientConnectionThank you in advance,
Bruno
