Author Topic: correct setup of a toolchain SOLVED  (Read 14697 times)

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
correct setup of a toolchain SOLVED
« 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?)
« Last Edit: June 02, 2013, 07:45:58 pm by demone »
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: correct setup of a toolchain
« Reply #1 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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: correct setup of a toolchain
« Reply #2 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 :/
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline osdt

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: correct setup of a toolchain
« Reply #3 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
« Last Edit: April 24, 2013, 08:39:54 am by osdt »

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: correct setup of a toolchain
« Reply #4 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)
« Last Edit: April 24, 2013, 06:44:17 pm by demone »
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570

Offline demone

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: correct setup of a toolchain SOLVED
« Reply #5 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 :)
processor: Intel Core 2 Quad.
ram: 4 GB
os: Vista
gfx card: Ati Radeon HD 5570