Code::Blocks Forums

User forums => Help => Topic started by: demone on April 24, 2013, 01:11:38 am

Title: correct setup of a toolchain SOLVED
Post by: demone on April 24, 2013, 01:11:38 am
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?)
Title: Re: correct setup of a toolchain
Post by: stahta01 on April 24, 2013, 01:51:03 am
Quote
Compiler directory:
C:\mingw32\bin

Did you use "C:\mingw32" as the toolchain folder (Compiler Installation Directory)?
If not, try doing so.

Tim S.
Title: Re: correct setup of a toolchain
Post by: 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 :/
Title: Re: correct setup of a toolchain
Post by: osdt on April 24, 2013, 08:32:21 am
Quote
Compiler directory:
C:\mingw32\bin
Did you use "C:\mingw32" as the toolchain folder (Compiler Installation Directory)?
If not, try doing so.

Tim S.
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 :/
There is something wrong with your setup. Post the full BuildLog (rebuild).

BTW: running the executable implies that the linkstep was successfull.

- osdt
Title: Re: correct setup of a toolchain
Post by: demone on April 24, 2013, 06:40:46 pm
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)
Title: Re: correct setup of a toolchain SOLVED
Post by: demone on April 24, 2013, 08:51:58 pm
OH finally! solved! I just reinstalled everything from scratch
I deleted the ming folder,
uninstalled C::B
runned ccleaner
installed codeblocks without mingw
downloaded mingwbuilds

setup everything like in the 1st post.

WORKED :)