Undefined symbol in FPC3.2.fixes / 3.3.1

I was just playing with CastleDownload

3.0.4 wanted opensslsockets so I added that only to find I needed >3.0.x

I’ve installed both 3.2 + 3.3.1 but they give me an error even with the CastleDownload stuff removed…

This is basically the project1 you’ve already seen but with the download being from a remote URL

The test URL is https://img.scryfall.com/cards/large/front/5/3/53fb7b99-9e47-46a6-9c8a-88e28b5197f1.jpg?1582126072

Messages, Hints: 12
Note: Duplicate unit "generics.strings" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.strings.ppu"
Note: Duplicate unit "generics.strings" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.strings.ppu"
Note: Duplicate unit "generics.memoryexpanders" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.memoryexpanders.ppu"
Note: Duplicate unit "generics.memoryexpanders" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.memoryexpanders.ppu"
Note: Duplicate unit "generics.helpers" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.helpers.ppu"
Note: Duplicate unit "generics.helpers" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.helpers.ppu"
Note: Duplicate unit "generics.hashes" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.hashes.ppu"
Note: Duplicate unit "generics.hashes" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.hashes.ppu"
Note: Duplicate unit "generics.defaults" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.defaults.ppu"
Note: Duplicate unit "generics.defaults" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.defaults.ppu"
Note: Duplicate unit "generics.collections" in "project1", orphaned ppu "C:\dev\castle\test01\lib\x86_64-win64\generics.collections.ppu"
Note: Duplicate unit "generics.collections" in "castle_base 6.5", orphaned ppu "C:\dev\castle_game_engine\packages\lib\castle_base\x86_64-win64\generics.collections.ppu"
Compile Project, Target: project1.exe: Exit code 1, Errors: 5, Hints: 2
Hint: Start of reading config file C:\lazcge\fpc\bin\x86_64-win64\fpc.cfg
Hint: End of reading config file C:\lazcge\fpc\bin\x86_64-win64\fpc.cfg
project1.lpr(21,1) Error: Undefined symbol: RESSTR_$GENERICS.STRINGS_$$_START$indirect
project1.lpr(21,1) Error: Undefined symbol: RESSTR_$GENERICS.STRINGS_$$_END$indirect
project1.lpr(21,1) Error: Undefined symbol: RTTI_$GENERICS.COLLECTIONS_$$_TCOLLECTIONNOTIFICATION$indirect
project1.lpr(21,1) Error: Undefined symbol: VMT_$GENERICS.DEFAULTS_$$_TGENERICSHASHFACTORY
project1.lpr(21,1) Error: Undefined symbol: FPC_EMPTYINTF

You should not need to do any CGE modifications to get https working.

view3dscene ( https://github.com/castle-engine/view3dscene/ , https://castle-engine.io/view3dscene.php ) has this in uses clause:

{$ifndef VER3_0} OpenSSLSockets, {$endif}

and this should be everything necessary to make HTTPS protocol working. I can load a file in view3dscene from URL https://raw.githubusercontent.com/castle-engine/castle-engine/master/examples/fps_game/data/knight_creature/knight.gltf (using the “File -> Open URL” feature in view3dscene, after turning on “File -> Preferences - > Download Resources From Network”).

Make sure to also set EnableNetwork := true, see https://castle-engine.io/manual_network.php#section_https_http .

Your errors suggest that the linker got confused about missing symbols, because you changed FPC versions, and different FPC versions may define different internal symbols. Just clean the compilation output (.ppu, .o) files when changing FPC version. (There’s a Lazarus command to “clean compile”. If you use CGE build tool, just castle-engine clean. You can also just manually remove lib, castle-engine-output directories.)

P.S. You can try examples/simple_command_line_utilities/castle_download.lpr to test downloading files from the command-line. It’s a bit like a simple wget or curl, implemented using CGE.

I just pushed a simple improvement to it, in https://github.com/castle-engine/castle-engine/commit/8922fc220cf73a75bf2fc5a6c64ce4596c3789b7 .

You can easily test that your URL works. Just compile (I’m using FPC 3.2.0-beta-r20:44874M on Linux/x86_64 now), run like

./castle_download 'https://img.scryfall.com/cards/large/front/5/3/53fb7b99-9e47-46a6-9c8a-88e28b5197f1.jpg?1582126072' > a.jpg

and the resulting a.jpg is correct.

Got it all working now, thanks