Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - jamesl22

Pages: [1]
1
General / Re: Hidden symbols when static linking
« on: June 11, 2018, 08:39:45 pm »
Changing the linking order unfortunately did not help. As you suggested, building the ckd binary without the libck dynamic library makes it build successfully:

Code: [Select]
g++ src/client/main.cpp.o src/client/rpcserver.cpp.o src/client/wallet.cpp.o src/client/httpserver.cpp.o src/client/multicoin.cpp.o src/kernel/blockchain.cpp.o src/kernel/blockchaintypes.cpp.o src/kernel/math.cpp.o src/kernel/storage.cpp.o src/kernel/network.cpp.o src/kernel/networkpeer.cpp.o src/kernel/base64.cpp.o src/kernel/crypto.cpp.o src/kernel/log.cpp.o src/kernel/contract.cpp.o src/kernel/consensus/AVRR.cpp.o src/kernel/consensus/PoW.cpp.o src/kernel/merkletree.cpp.o src/kernel/consensus/regtest.cpp.o src/kernel/consensus/Lyra2REv2/Lyra2RE.c.o src/kernel/consensus/Lyra2REv2/Lyra2.c.o src/kernel/consensus/Lyra2REv2/Sponge.c.o src/kernel/consensus/Lyra2REv2/sha3/blake.c.o src/kernel/consensus/Lyra2REv2/sha3/cubehash.c.o src/kernel/consensus/Lyra2REv2/sha3/keccak.c.o src/kernel/consensus/Lyra2REv2/sha3/skein.c.o src/kernel/consensus/Lyra2REv2/sha3/bmw.c.o -o ckd -L/usr/lib -I. -L. -L/usr/local/lib -Wl,-rpath -Wl,./ -lsfml-network -lsfml-system -llua5.3 -lcrypto -ldl -pthread -lleveldb -lmicrohttpd -ljsonrpccpp-common -ljsonrpccpp-server -ljsonrpccpp-client -lcurl -lgcov -ljsoncpp
/usr/local/lib/liblua5.3.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x2b0): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
Removing intermediate container 983225e60510
 ---> 5346ce542187
Successfully built 5346ce542187

I am still curious though why I cannot statically link SFML with my dynamic libck library. The motivation being that libck is distinct from ckd and could even be seperate repos in the future.

2
General / Re: Hidden symbols when static linking
« on: June 11, 2018, 08:59:19 am »
Code: [Select]
Step 52/52 : RUN make KERNELCXXFLAGS="-DSFML_STATIC -I`pwd`/src/kernel"
 ---> Running in ba0b5eceb2be
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/blockchain.cpp -o src/kernel/blockchain.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/blockchaintypes.cpp -o src/kernel/blockchaintypes.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/math.cpp -o src/kernel/math.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/storage.cpp -o src/kernel/storage.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/network.cpp -o src/kernel/network.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/networkpeer.cpp -o src/kernel/networkpeer.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/base64.cpp -osrc/kernel/base64.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/crypto.cpp -osrc/kernel/crypto.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/log.cpp -o src/kernel/log.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/contract.cpp -o src/kernel/contract.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/consensus/AVRR.cpp -o src/kernel/consensus/AVRR.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/consensus/PoW.cpp -o src/kernel/consensus/PoW.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/kernel/merkletree.cpp -o src/kernel/merkletree.cpp.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/Lyra2RE.c -o src/kernel/consensus/Lyra2REv2/Lyra2RE.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/Lyra2.c -o src/kernel/consensus/Lyra2REv2/Lyra2.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/Sponge.c -o src/kernel/consensus/Lyra2REv2/Sponge.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/sha3/blake.c -o src/kernel/consensus/Lyra2REv2/sha3/blake.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/sha3/cubehash.c -o src/kernel/consensus/Lyra2REv2/sha3/cubehash.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/sha3/keccak.c -o src/kernel/consensus/Lyra2REv2/sha3/keccak.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/sha3/skein.c -o src/kernel/consensus/Lyra2REv2/sha3/skein.c.o
gcc -fPIC -O3 -c src/kernel/consensus/Lyra2REv2/sha3/bmw.c -o src/kernel/consensus/Lyra2REv2/sha3/bmw.c.o
g++ -shared -L/usr/lib src/kernel/blockchain.cpp.o src/kernel/blockchaintypes.cpp.o src/kernel/math.cpp.o src/kernel/storage.cpp.o src/kernel/network.cpp.o src/kernel/networkpeer.cpp.o src/kernel/base64.cpp.o src/kernel/crypto.cpp.o src/kernel/log.cpp.o src/kernel/contract.cpp.o src/kernel/consensus/AVRR.cpp.o src/kernel/consensus/PoW.cpp.o src/kernel/merkletree.cpp.o src/kernel/consensus/Lyra2REv2/Lyra2RE.c.o src/kernel/consensus/Lyra2REv2/Lyra2.c.o src/kernel/consensus/Lyra2REv2/Sponge.c.o src/kernel/consensus/Lyra2REv2/sha3/blake.c.o src/kernel/consensus/Lyra2REv2/sha3/cubehash.c.o src/kernel/consensus/Lyra2REv2/sha3/keccak.c.o src/kernel/consensus/Lyra2REv2/sha3/skein.c.o src/kernel/consensus/Lyra2REv2/sha3/bmw.c.o -o libck.so
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/client/main.cpp -o src/client/main.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/client/rpcserver.cpp-o src/client/rpcserver.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/client/wallet.cpp -osrc/client/wallet.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/client/httpserver.cpp -o src/client/httpserver.cpp.o
g++ -DSFML_STATIC -I/cryptokernel/src/kernel -fPIC -I/usr/include/lua5.3 -c src/client/multicoin.cpp-o src/client/multicoin.cpp.o
g++ src/client/main.cpp.o src/client/rpcserver.cpp.o src/client/wallet.cpp.o src/client/httpserver.cpp.o src/client/multicoin.cpp.o -o ckd -L/usr/lib -I. -L. -L/usr/local/lib -Wl,-rpath -Wl,./ -lck -llua5.3 -lcrypto -ldl -pthread -lleveldb -lmicrohttpd -ljsonrpccpp-common -ljsonrpccpp-server -ljsonrpccpp-client -lcurl -lgcov -ljsoncpp -lsfml-network -lsfml-system
/usr/local/lib/liblua5.3.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x2b0): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/x86_64-linux-gnu-ld: ckd: hidden symbol `_ZN2sf9IpAddress15getLocalAddressEv' in /usr/local/lib/libsfml-network.a(IpAddress.cpp.o) is referenced by DSO
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:92: recipe for target 'ckd' failed
make: *** [ckd] Error 1
The command '/bin/sh -c make KERNELCXXFLAGS="-DSFML_STATIC -I`pwd`/src/kernel"' returned a non-zero code: 2

I can give you a Dockerfile so you can reproduce it exactly if that helps you.

3
General / Hidden symbols when static linking
« on: June 11, 2018, 05:27:23 am »
Hello,

I use SFML in my project Cryptokernel for networking (https://github.com/mit-dci/CryptoKernel). I'm trying to produce static binaries for distribution on Linux, and whilst I have this working on Windows, I cannot link SFML statically on Linux.

I used the following to build SFML:

Code: [Select]
git clone https://github.com/SFML/SFML.git
cd SFML
cmake . -DBUILD_SHARED_LIBS=NO -DSFML_BUILD_DOC=NO -DSFML_BUILD_AUDIO=NO \
-DSFML_BUILD_GRAPHICS=NO -DSFML_BUILD_WINDOW=NO -DSFML_BUILD_EXAMPLES=NO \
-DCMAKE_BUILD_TYPE=Release
make && make install
cp /usr/local/lib/libsfml-network-s.a /usr/local/lib/libsfml-network.a && cp /usr/local/lib/libsfml-system-s.a /usr/local/lib/libsfml-system.a

But when linking my project (with -DSFML_STATIC):

Code: [Select]
/usr/bin/x86_64-linux-gnu-ld: ckd: hidden symbol `_ZN2sf9IpAddress15getLocalAddressEv' in /usr/local/lib/libsfml-network.a(IpAddress.cpp.o) is referenced by DSO
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Using nm it doesn't seem to be hidden though:
Code: [Select]
...
                 U _ZN2sf4priv10SocketImpl13invalidSocketEv
                 U _ZN2sf4priv10SocketImpl5closeEi
                 U _ZN2sf6SocketD2Ev
0000000000000460 T _ZN2sf9IpAddress15getLocalAddressEv
00000000000009a0 T _ZN2sf9IpAddress16getPublicAddressENS_4TimeE
0000000000000010 B _ZN2sf9IpAddress3AnyE
0000000000000018 B _ZN2sf9IpAddress4NoneE
...

I would appreciate a pointer as to what could be going wrong here.

Thanks,

James

4
SFML projects / Re: SFML Light System - Let There Be Light
« on: August 08, 2013, 10:56:47 am »
Hi,

I am trying to implement LTBL into my game engine but I am struggling. I cannot get lights to render in the scene. Here is my code:

Engine::LightSystem::LightSystem(sf::RenderWindow &Window)
{
    ls = new ltbl::LightSystem(AABB(Vec2f(0.0f, 0.0f), Vec2f(16384.0f, 16384.0f)), &Window, "data/lightFin.png", "data/shaders/lightAttenuationShader.frag");

    Light = new ltbl::Light_Point();
    Light->m_center = Vec2f(200.0f, 1000.0f);
    Light->m_radius = 64.0f;
    Light->m_size = 30.0f;
    Light->m_intensity = 1.0f;
    Light->m_spreadAngle = 2.0f * 3.14159f;
    Light->m_softSpreadAngle = 0.0f;
    Light->CalculateAABB();
    ls->AddLight(Light);
}

void Engine::LightSystem::RenderLights(sf::View &View)
{
    ls->SetView(View);
    // Calculate the lights
    ls->RenderLights();
    // Draw the lights
    ls->RenderLightTexture();
}
 

I have attached an image of the problem. You will notice that LTBL is rendering the dark texture over the top.

Pages: [1]