Thanks for the help.
1. Changing arguments order resulted in the same error as before. Here follows the return from the cmd
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -l-LC:\Octave\Octave-4.2.0\lib\octave\4.2.0
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctinterp
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctave
collect2.exe: error: ld returned 1 exit status
warning: mkoctfile: building exited with failure status
2. Running cmd the command with -v returns me the following:
mkoctfile -v -l lib/x86/dwf.lib samples/c/analogin_sample.cpp
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -l-LC:\Octave\Octave-4.2.0\lib\octave\4.2.0
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctinterp
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctave
collect2.exe: error: ld returned 1 exit status
g++ -std=gnu++11 -c -I/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/include -IC:\Octave\Octave-4.2
.0\include\octave-4.2.0\octave\.. -IC:\Octave\Octave-4.2.0\include\octave-4.2.0\octave -IC:\Octave\Octave-4.2.0\i
nclude -pthread -fopenmp -g -O2 samples/c/analogin_sample.cpp -o analogin_sample.o
g++ -std=gnu++11 -IC:\Octave\Octave-4.2.0\include\octave-4.2.0\octave\.. -IC:\Octave\Octave-4.2.0\include\octave-
4.2.0\octave -IC:\Octave\Octave-4.2.0\include -pthread -fopenmp -g -O2 -shared -o dwf.oct analogin_sample.o l
ib/x86/dwf.lib -l -LC:\Octave\Octave-4.2.0\lib\octave\4.2.0 -LC:\Octave\Octave-4.2.0\lib -loctinterp -loctave -W
l,-rpath-link,/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w64
-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -Wl,--export-all
-symbols -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w6
4-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -
L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_
64-w64-mingw32/lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -lfreetype -lhdf5 -lGrap
hicsMagick++ -lGraphicsMagick -lz -lfftw3 -lfftw3f -lopengl32 -lglu32 -L/scratch/jwe/mxe-octave/4.2.0/w64-32/u
sr/x86_64-w64-mingw32/lib -lfontconfig -lfreetype -lgl2ps -ladvapi32 -llapack -lws2_32 -lws2_32 -lws2_
32 -lcurl -lcholmod -lumfpack -lamd -lcamd -lcolamd -lccolamd -lcxsparse -lsuitesparseconfig -larpack -lqrup
date -lfftw3 -lfftw3f -llapack -lblas -lreadline -ltermcap -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w
64-mingw32/lib -lpcre -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/x86_64-w64-mingw32/lib -L/scratch/jwe/mxe-oct
ave/4.2.0/w64-32/usr/lib/gcc/x86_64-w64-mingw32/4.9.4 -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/lib/gcc/x86_64-w
64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/lib/../lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/mingw/lib/.
./lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/
lib -L/scratch/jwe/mxe-octave/4.2.0/w64-32/usr/mingw/lib -lm -lgfortran -lmingw32 -lmoldname -lmingwex -lmsvcrt -
lquadmath -ladvapi32 -lshell32 -luser32 -lkernel32 -lm -lgdi32 -lws2_32 -luser32 -lkernel32 -lgdi32 -lws2_32 -l
user32 -lkernel32
warning: mkoctfile: building exited with failure status
3. Result using 64b library (that's actually the right library I should use, as my Windows is 64 b)
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -l-LC:\Octave\Octave-4.2.0\lib\octave\4.2.0
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctinterp
c:/octave/octave-4.2.0/bin/../lib/gcc/x86_64-w64-mingw32/4.9.4/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot
find -loctave
collect2.exe: error: ld returned 1 exit status
warning: mkoctfile: building exited with failure status
4. Strangely, linker cannot find library octave and library octinterp, even though if I issue
I can see those libraries.