Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Hi, there is an example in my textbook, it contains three files: main.c, readline.c and readline.h.
I build the project as picture 1 illustrated, and I'm sure no spelling mistake exists.
But when I compiling the project using codeblocks, an error appeared always: undefined reference to 'read_line', as the picture 0 illustrated.(readline.c contains the function definition of 'read_line()')
I checked the project carefully, I think no inappropriate exists (#include "readline.h" has added in main.c). When I move the function definition of read_line() to main.c, and compiling, then no error appeared.
How to fix this problem?
Best regards.

42
Help / nothing detected about the Compilers in CodeBlocks
« Last post by berce on February 14, 2019, 12:45:00 pm »
Hi everyone!

CodeBlocks could not detect any compilers it was added path to environment variables
I installed mingw64 8.1.0 from https://sourceforge.net/p/mingw-w64/mingw-w64

I installed visual studio 2017 in diffirent path ama but not showing in auto-detection
acutally it could not detect anything
I manually changed gnu gcc file names in toolchain executables tab




would you fix in future
43
Thank you for the information, but direct editing of the XML files is not a good idea; Using the Global Compiler Settings is a lot easier and less prone to errors.
44
Thank you very much, with your help I could solve the problem (so I think). In case somebody has a similar problem, here is what I did:

There are two versions of the file "options_pgifortran.xml" on the computer:
one here:           C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\compilers
the second here: C:\Users\dib05004\AppData\Roaming\CodeBlocks\share\codeblocks\compilers

only changes to the second (after making a backup copy) seems necessary.
I changed:

  <Program name="LIB" value="C:\Program Files\PGICE\win64\18.4\bin\ar.exe"/>
  <Switch name="libExtension" value="a"/>
  <Command name="LinkStatic" value="$lib_linker -r $static_output $link_objects&#xA;&#x9;ranlib $exe_output"/>

into:

  <Program name="LIB" value="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64\lib.exe"/>
  <Switch name="libExtension" value="lib"/>
  <Command name="LinkStatic" value="$lib_linker  $link_objects $libs /OUT:$exe_output"/>

The first change points to the library manager of Microsoft for x64 host and x64 code. The third invoces this with the correct option for setting the output file name. I found the second change necessary, since otherwise the library gets the extension "a", regardless of what one sets in the "Project Properties -> target" dialog.

Hence, many thanks!
45
Using Code::Blocks / Re: Code::Blocks randomly crashing
« Last post by Kvalifik on February 14, 2019, 08:24:29 am »
Yes, the SpellChecker plugin is disabled and no craching since 10 days.
46
1. Do not use lambda captures if you don't understand them.
Oh, I need to learn it. Should be easy.  :)
Quote
2. Why do you need a capture in this case? The frame is passed as a parameter.
You are correct, no need capture here.

Quote
3. What does Temp mean? To me it is the same as using My, Mine, Random, Some, etc.
What about shortLiveFrame or transientFrame?
47
Copy a compiler then edit the advanced compiler options.

This is what Command: Link Object files to static library shows for "PGI Fortran Compiler"
Code: [Select]
$lib_linker -r $static_output $link_objects
ranlib $exe_output

Tab: Other Settings Button: Advanced Options
48
Using Code::Blocks / Re: wxsmith plugin, where is it?
« Last post by jjenson on February 13, 2019, 11:20:10 pm »
If you make this command
Code: [Select]
dpkg-buildpackage -us -uc
to succeed you'll have the same packages you download from the site, but they'll have the proper dependencies and they will work on your system.

When I do that I get:

rmdir --ignore-fail-on-non-empty .
rmdir: failed to remove '.': Invalid argument
/usr/share/cdbs/1/class/autotools.mk:64: recipe for target 'makefile-clean' failed
make: [makefile-clean] Error 1 (ignored)


which continues with what looks like productive compiling, followed by a lot of checking and then a lot of creating which looks like the completion of a config.

then make is invoked with /usr/bin/make -C . -j8

followed by x86_64-linux-gnu-g++
 
Then this fatal error pops up.

In file included from ./sdk_precomp.h:13:0:
./sdk_common.h:37:10: fatal error: wx/wxprec.h: No such file or directory
 #include <wx/wxprec.h>


I checked; there actually is a wxprec.h file in /usr/include/wx-3.0/wx/

..but for some reason, it can't find it. Like I said before, I have decades of programming experience, but I've only a few months experience working in a Linux environment, so a lot of this stuff is new to me; however, I am more than willing to learn if someone can help me out and point me in the right direction.
49
Using Code::Blocks / C::B adds options to lib.exe (-r ; ranlib ) that i can not remove.
« Last post by BDick on February 13, 2019, 11:07:53 pm »
I want to make a static library for windows with the PGI compiler. Compiling and linking of executables with pgfortran works fine, but the built of the library fails. In "settings" the toolchain is set so that "C-compiler", "C++ compiler", and "linker for dynamic libs" all point to pgfortran.exe, and "linker for static libs" points to the lib.exe from Microsoft.

The correct call should be: lib.exe name.o
and generates name.lib

I test this in a command shell.
However, C::B issues the command: lib.exe -r name.a name.o ranlib name.a

How can I tell C::B to omit "-r name.a" and "ranlib name.a"? In the varous dialog boxes I can ADD more options, but I can apparently not REMOVE those superfluous ones.

best regards,
Bernhard
50
No. Thanks for asking.
Pages: 1 2 3 4 [5] 6 7 8 9 10