cst tools windows compile

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cst tools windows compile

1,215 Views
rohith_chinnasw
Contributor II

Hi,

I downloaded the cst tool 3.0.1 and im trying to compile the csp.exe in windows using the steps listed in release notes. The reason i need to recompile is eventually I have to modify this tool to run with a adaption plugin to sign the image using HSM.

So as a first step i tried to recompile the cst with the following command

cd <CST install directory/code/back_end/src
i686-w64-mingw32-gcc -o cst.exe -I ../hdr -L ../../../mingw32/lib \
*.c -lfrontend -lcrypto

The error i get is 

i686-w64-mingw32-gcc -o cst.exe -I ../hdr -L ../../../mingw32/lib \ *.c -lfrontend -lcrypto
C:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find \: No such file or directory
collect2.exe: error: ld returned 1 exit status

I am not sure what is wrong here. Is there something wrong with the command?

The steps from release note

To relink on Windows machines:
This requires the MINGW compiler and OpenSSL header files and
library. The easiest way to get them is to install Cygwin

cd <CST install directory/code/back_end/src
i686-w64-mingw32-gcc -o cst.exe -I ../hdr -L ../../../mingw32/lib \
*.c -lfrontend -lcrypto
cp cst ../../../mingw32

Labels (1)
Tags (3)
0 Kudos
3 Replies

948 Views
jimmychan
NXP TechSupport
NXP TechSupport

the backslash ' \ ' is used as a line continuation character.

please try this:

i686-w64-mingw32-gcc -o cst.exe -I ../hdr -L ../../../mingw32/lib *.c -lfrontend -lcrypto

0 Kudos

948 Views
rohith_chinnasw
Contributor II

Thanks for the reply. Yes I did try this before and I get different errors for it 

../../../mingw32/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1093): undefined reference to `_imp__GetDeviceCaps@8'
../../../mingw32/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x10c1): undefined reference to `_imp__CreateCompatibleBitmap@12'
../../../mingw32/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x10df): undefined reference to `_imp__GetObjectA@12'
../../../mingw32/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x11bd): undefined reference to `_imp__GetDIBits@28'
../../../mingw32/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0x1221): undefined reference to `_imp__DeleteObject@4'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x5c): undefined reference to `inflate'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0xdf): undefined reference to `deflate'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x12d): undefined reference to `inflateEnd'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x149): undefined reference to `deflateEnd'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x1b4): undefined reference to `inflateEnd'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x1bf): undefined reference to `deflateEnd'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x25b): undefined reference to `inflateInit_'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x2d0): undefined reference to `deflateInit_'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x57a): undefined reference to `deflate'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x658): undefined reference to `zError'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x816): undefined reference to `deflate'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x8a8): undefined reference to `zError'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0x947): undefined reference to `deflateInit_'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0xa2e): undefined reference to `inflate'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0xa98): undefined reference to `zError'
../../../mingw32/lib/libcrypto.a(c_zlib.o):c_zlib.c:(.text+0xb20): undefined reference to `inflateInit_'
collect2.exe: error: ld returned 1 exit status

0 Kudos

948 Views
rohith_chinnasw
Contributor II

So using this command worked, the additional linker options for libgdi and libz might have been because of the openssl version i have

i686-w64-mingw32-gcc -o cst.exe -I ../hdr -L ../../../mingw32/lib *.c -lfrontend -lcrypto -lgdi32
-lz

0 Kudos