User forums > Using Code::Blocks

Cygwin GCC-4 linker options -> Progect buld options?

(1/2) > >>

DBS:
I am new in code::blocks, and I am stuck with this problem.

I can compile and build my code with a command-line call to cygwin gcc-4, both from within cygwin and from Windows (7, professional, 64 bit) cmd.  Code::blocks IDE can compile the code, but I have no luck with linking. I can link the object files and produce an executable with this command line:

c:\cygwin\bin\gcc-4 -Wall -Wwrite-strings -Wno-strict-aliasing -g3  -o ex1 ex1.o  -Wl,-rpath,/home/PETScSource/petsc-3.1-p5/cygwin7/lib -L/home/PETScSource/petsc-3.1-p5/cygwin7/lib  -lpetsc  -lf2clapack -lf2cblas -lX11

but I cannot link from the IDE.

I specify the libraries explicitly in Project build options -> linker settings.  No luck.

What do I do wrong?

Thanks.

stahta01:
Turn on full Compiler Logging and compare what Code::blocks does to what is needed.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

What version of Code::Blocks?
What version of Windows?

Note: Cygwin is not always working very well under Code::Blocks.

Tim S.

DBS:
Tim,

Thank you for your suggestions.
I use Code::blocks 10.05 Rev 6283
The system is Windows 7 Professional 64 bit installed on Dell Precision Laptop
The cygwin is version 1.7

I have compiled other projects with cygwin GNU compiler no problem. 
I think that the problem is with the option -Wl,-rpath,/home/PETScSource/petsc-3.1-p5/cygwin7/lib
When building through code::blocks, the messages are about unresolved references in the libraries.

I cannot find how to make Code::blocks to call the linker correctly.  Linking via command line works Ok, with the same .o file.

DBS

xunxun:
C::B on windows cannot recognize Linux style path. You should replace the path with windows style path.

DBS:
xunxun,

Parameters are passed to the compiler, so unix-style path should be used. 
Nevertheless, I have tried windows path: does not help.

The linker works through Project->Options->makefile, but Buid->clean does not

Should there be a way to pass the same parameters via build options.

Navigation

[0] Message Index

[#] Next page

Go to full version