1
General / Re: dynamic code loading problem
« on: August 13, 2019, 06:17:09 pm »Try to call the DLL function before unloading the DLL.
I’ve tried that, it doesn’t make a difference.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Try to call the DLL function before unloading the DLL.
If you link to static SFML libraries, you must define the SML_STATIC preprocessor symbol, as stated in the tutorial.
gameCode.h(6): warning C4190: 'CreateRect' has C-linkage specified, but returns UDT 'sf::RectangleShape' which is incompatible with C
C:\SFML_Projects\SFML_CONSOLE_DEV\CJsfml_002\src>build
gameCode.cpp
Creating library gameCode.lib and object gameCode.exp
gameCode.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl sf::RectangleShape::setSize(class sf::Vector2<float> const &)" (__imp_?setSize@RectangleShape@sf@@QEAAXAEBV?$Vector2@M@2@@Z) referenced in function CreateRect
gameCode.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl sf::RectangleShape::~RectangleShape(void)" (__imp_??1RectangleShape@sf@@UEAA@XZ) referenced in function CreateRect
@echo off
IF NOT DEFINED winLibs SET winLibs = user32.lib gdi32.lib winmm.lib Opengl32.lib ws2_32.lib advapi32.lib
IF NOT DEFINED sfmlDependLibsX64 (SET sfmlDependLibsX64 = /LIBPATH:"C:\SFML\SFML-2.5.1_x64\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib)
IF NOT DEFINED sfmlDependLibsX86 (SET sfmlDependLibsX86 = /LIBPATH:"C:\SFML\SFML-2.5.1_x86\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib)
If NOT EXIST ..\buildx64 mkdir ..\buildx64
If NOT EXIST ..\buildx86 mkdir ..\buildx86
pushd ..\buildx64
cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp /link user32.lib gdi32.lib winmm.lib Opengl32.lib ws2_32.lib advapi32.lib /LIBPATH:"C:\SFML\SFML-2.5.1_x64\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
popd
:: ------------------ x86 BUILD (set vcvarsx86) -----------------
:: pushd ..\buildx86
::
:: cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp user32.lib gdi32.lib winmm.lib Opengl32.lib ws2_32.lib advapi32.lib /link /LIBPATH:"C:\SFML\SFML-2.5.1_x86\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
::
::
:: popd
del *.~ *.cpp~ *.bat~ *.un~
@echo off
IF NOT DEFINED winLibs (SET winLibs = user32.lib gdi32.lib winmm.lib Opengl32.lib ws2_32.lib advapi32.lib)
IF NOT DEFINED sfmlDependLibsX64 (SET sfmlDependLibsX64 = /LIBPATH:"C:\SFML\SFML-2.5.1_x64\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib)
IF NOT DEFINED sfmlDependLibsX86 (SET sfmlDependLibsX86 = /LIBPATH:"C:\SFML\SFML-2.5.1_x86\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib)
IF NOT DEFINED sfmlLibsX64 (SET sfmlLibsX64 = /LIBPATH:"C:\SFML\SFML-2.5.1_x64\lib"sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib)
IF NOT DEFINED sfmlLibsX86 (SET sfmlLibsX86 = /LIBPATH:"C:\SFML\SFML-2.5.1_x86\lib"sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib)
If NOT EXIST ..\buildx64 mkdir ..\buildx64
If NOT EXIST ..\buildx86 mkdir ..\buildx86
pushd ..\buildx64
cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp %winLibs% /link /LIBPATH:"C:\SFML\SFML-2.5.1_x64\lib" %sfmlDependLibsX64% %sfmlLibsX64%
popd
:: ------------------ x86 BUILD (set vcvarsx86) -----------------
:: pushd ..\buildx86
::
:: cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp user32.lib gdi32.lib winmm.lib Opengl32.lib ws2_32.lib advapi32.lib /link /LIBPATH:"C:\SFML\SFML-2.5.1_x86\lib" freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
::
::
:: popd
del *.~ *.cpp~ *.bat~ *.un~
@echo off
REM set CompilerFlags = -Zi
SET winLibs = user32.lib gdi32.lib winmm.lib opengl32.lib ws2_32.lib advapi32.lib
SET sfmlDependLibs = /LIBPATH:..\lib freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib
If NOT EXIST ..\build mkdir build
pushd ..\build
cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp %winLibs% /link /LIBPATH:..\lib %sfmlDependLibs% sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
popd
del *.~ *.cpp~ *.bat~ *.un~
@echo off
REM set CompilerFlags = -Zi
SET winLibs = user32.lib gdi32.lib winmm.lib opengl32.lib ws2_32.lib advapi32.lib
SET sfmlDependLibs = /LIBPATH:..\lib freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib
SET sfmlStaticRelLibs = /LIBPATH:..\lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
If NOT EXIST ..\build mkdir build
pushd ..\build
cl /MD /EHsc -Zi -nologo /I ..\include ..\src\CJsfml_001.cpp %winLibs% /link /LIBPATH:..\lib %sfmlDependLibs% %sfmlStaticRelLibs%
popd
del *.~ *.cpp~ *.bat~ *.un~
@echo off
REM set Windows_Libs = user32.lib gdi32.lib winmm.lib opengl32.lib ws2_32.lib
REM set SFML_Libs = sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib sfml-system-s.lib
REM set CompilerFlags = -Zi
If NOT EXIST ..\build mkdir build
pushd ..\build
cl /MD /EHsc -Zi /I ..\include ..\src\CJsfml_001.cpp user32.lib gdi32.lib winmm.lib opengl32.lib ws2_32.lib /link /LIBPATH:..\lib freetype.lib openal32.lib flac.lib vorbisenc.lib vorbisfile.lib vorbis.lib ogg.lib sfml-system-s.lib sfml-graphics-s.lib sfml-window-s.lib sfml-audio-s.lib sfml-network-s.lib
popd