User forums > Help
correct setup of a toolchain SOLVED
demone:
I have downloaded mingw-builds (GCC 4.8, sjlj 32 bit for windows). I correctly settedup the toolchain,
however I'm still not able to correctly link libraries (I can build executables, static libraries and dynamic libraries), but it don't link them!
I have the following files in same directory (F:\project\)
libtestdyn.a
libtestdyn.def
libtestlib.a
testdyn.dll
main.cpp.o
but buildling with following command doesn't work:
i686-w64-mingw32-g++.exe -L"F:\project\" -o c++11test.exe .\main.cpp.o -ltestdyn -ltestlib
I missed something particular? :/
This is the error i get:
fatal error: no input files
As far as I know all the required files are in the "F:\project\" directory wich is already passed by -L.
that's really disappointing.
Is the setup correct (so correct c::b usage) or I have to ask somewhere else (in that case.. where?)
stahta01:
--- Quote ---Compiler directory:
C:\mingw32\bin
--- End quote ---
Did you use "C:\mingw32" as the toolchain folder (Compiler Installation Directory)?
If not, try doing so.
Tim S.
demone:
that folder is correct otherwise I can't build the files. The compiling is working right (and also running executable and the debugger and its breakpoints). It's just the linking that is messed up :/
osdt:
--- Quote from: stahta01 on April 24, 2013, 01:51:03 am ---
--- Quote ---Compiler directory:
C:\mingw32\bin
--- End quote ---
Did you use "C:\mingw32" as the toolchain folder (Compiler Installation Directory)?
If not, try doing so.
Tim S.
--- End quote ---
--- Quote from: demone on April 24, 2013, 07:35:06 am ---that folder is correct otherwise I can't build the files. The compiling is working right (and also running executable and the debugger and its breakpoints). It's just the linking that is messed up :/
--- End quote ---
There is something wrong with your setup. Post the full BuildLog (rebuild).
BTW: running the executable implies that the linkstep was successfull.
- osdt
demone:
Yes I run executables correctly, linking is correct for object files, but for ".a" and "dll" files it fails (I tried both only a static library and only a dynamic library)
C:/Mingw
not
C:/Mingw/bin (i wrote it instead of copy pastin like for the others)
here's the build log:
Build started on: 24-04-2013 at 18:37.41
Build ended on: 24-04-2013 at 18:37.49
-------------- Build: static_lib in snippet (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -std=c++11 -Wextra -Wall -c "D:\snippets\StaticLibrary.cpp" -o .\StaticLibrary.cpp.o
ar.exe -r -s libtest_static.a .\StaticLibrary.cpp.o
ar.exe: creating libtest_static.a
Output size is 1.67 KB
-------------- Build: dyn_lib in snippet (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -std=c++11 -Wextra -Wall -DDLL_EXPORT -c "D:\snippets\DynamicLibrary.cpp" -o .\DynamicLibrary.cpp.o
i686-w64-mingw32-g++.exe -shared -Wl,--output-def=libtest_dyn.def -Wl,--out-implib=libtest_dyn.a -Wl,--dll .\DynamicLibrary.cpp.o -o test_dyn.dll
Output size is 63.82 KB
-------------- Build: main in snippet (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -std=c++11 -Wextra -Wall -c "D:\snippets\main.cpp" -o .\main.cpp.o
i686-w64-mingw32-g++.exe -L"D:\snippets\" -o c++11test.exe .\main.cpp.o -ltest_dyn -ltest_static
i686-w64-mingw32-g++.exe: fatal error: no input files
compilation terminated.
Process terminated with status 1 (0 minutes, 8 seconds)
0 errors, 0 warnings (0 minutes, 8 seconds)รน
(and yes I have __declspec(dllexport) for the dynamic library)
Navigation
[0] Message Index
[#] Next page
Go to full version