Using Codelite on Mac with wxWidgets but Language Server cannot wx includes - macos

I have installed Codelite 15.0.6 and also wxWidgets-3.1.5 from source using procedure on this site. https://docs.codelite.org/build/build_wx_widgets/ When creating project using wxCrafter - wxDialog or any wx[Method] the project can not clean or build.
/usr/bin/make -j16 -e -f Makefile clean
----------Cleaning project:[ C-Simple-Projects - Debug ]----------
make[1]: wx-config: Command not found
make[1]: wx-config: Command not found
rm -f -r ../build-Debug/C-Simple-Projects
=== build completed successfully (0 errors, 0 warnings) ===
I can understand the Compiler & Linker Options setting which calls wx-config --cxxflags is unable to be found, but calling wx-config --cxxflags from the command line works.
sudo make install
which completed successfully and can find wx-config in my shell using terminal.
> % wx-config --cxxflags
-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__
My problem is also that the Language Server shows file not found.

Changed settings for make in the project to "default" and the application started building. Issue is related to Codelite makefile generator setting. I also changed the compiler options to include fully qualified path to wx-config executable. Will try to use Save as Template - see if that will generate other projects with these setting preconfigured. Fingers crossed. actually adding -std=cxx17 to linker options did the trick. resolved!

Related

Errors when compiling wxWidgets

I'm following this tutorial to begin with Code::Blocks using wxWidgets.
Following the tutorial, my first step was:
cd C:\wxWidgets-3.0.3\build\msw
Since I have the mingw32-make.exe installed in the directory C:\Program Files\CodeBlocks\MinGW\bin, next I do the following (again based on the tutorial):
C:\wxWidgets-3.0.3\build\msw>"C:\Program Files\CodeBlocks\MinGW\bin\mingw32-make" -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
The output I get is:
gcc -c -o gcc_mswu\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I
..\..\include -I..\..\lib\gcc_lib\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswu\wxr
egex_regcomp.o -MFgcc_mswu\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5702: recipe for target 'gcc_mswu\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswu\wxregex_regcomp.o] Error 1
I think that gcc is not found, so I need to edit the makefile.gcc
Am I right?
I'm not used to makefiles, so, I apologize but I need some help.
Open a command box and cd C:\wxWidgets-3.0.3\build\msw
Type and press enter:
PATH=%PATH%;C:\Program Files\CodeBlocks\MinGW\bin
This will add the mingw needed files (they execute chained) to your PATH, only for the command box. If you want it permanent, modify PATHenviroment var in you Windows settings.
Now run the command to compile wxWidgets:
mingw32-make" -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1 CXXFLAGS="-std=gnu++11" The std=gnu+11 flag is default (not needed) if your mingw version uses gcc >=5.2. Use it anyhow, it's harmless.
Adding RUNTIME_LIBS=static may avoid to have a couple of mingw libs visible (on the path). This way you can run your app without providing those libs.
Probably you'll get zillions of warnings (not errors) about "deprecating" with BestSize. That's a gcc <5.3 bug, not wx one.
You can get rid of those messages modifying a few lines at include/wx/window.h But better don't use the old version that ships with CB and download the newest one from http://www.mingw.org/

How to find actual location of library used by linker (gcc)

I have this compile command
qcc -Vgcc_ntoarmv7le -lang-c++ -Wl,-rpath-link,\
C:\Users\mureadr\Desktop\A\QNX_SDK\target\qnx6/armle-v7/lib -Wl,-rpath-link,\
C:\Users\mureadr\Desktop\A\QNX_SDK\target\qnx6/armle-v7/usr/lib -Wl,-O1 -Wl,-rpath,\
C:/fs/mp/qt5/lib -Wl,-rpath,C:/fs/mp/fordhmi/lib -shared -Wl,-soname,libHmiLogging.so.1\
-o libHmiLogging.so.1.0.0 .obj/hmiloggingcategory.o .obj/hmiloggingcategoryregistry.o\
.obj/hmiperformancelogging.o .obj/hmitracelogging.o\
-LC:\Users\mureadr\Desktop\A\QNX_SDK\target\qnx6/armle-v7/lib \
-LC:\Users\mureadr\Desktop\A\QNX_SDK\target\qnx6/armle-v7/usr/lib \
-LC:/Users/mureadr/Desktop/A/HMI_FORGF/qt5binaries/lib -lQt5Core \
-LC:/QNX650/target/qnx6/armle-v7/lib -LC:/QNX650/target/qnx6/armle-v7/usr/lib -lm
When I run it under make, it runs fine but using another build system, I get the error
C:\Users\mureadr\Desktop\A\QNX_SDK\host\win32\x86\usr\bin\ntoarm-ld: cannot find -lQt5Core
cc: C:/Users/mureadr/Desktop/A/QNX_SDK/host/win32/x86/usr/bin/ntoarm-ld caught signal 1
Obviously the other build system doesn't have access to all the included directories.
Question
How can I find out which directory Qt5Core was pulled from?
Is there a linker option that will make it say I got Qt5Core from directory X?
I ran make with --debug=a but I didn't get any info about Qt5Core.
Is there a linker option that will make it say I got Qt5Core from directory X?
Yes. It is -trace. To pass it via gcc, use gcc ... -Wl,-trace....
This will cause the linker to print the name of each input (object file or library) that
it receives from the commandline together with the absolute path where it located
the same.
BTW, passing debug options to make will produce debugging info from make
but none from tools that are invoked by make.

make: f77: No such file or directory

Whilst attempting to make/compile the grafic package, I'm seeing this error after calling the make command within the grafic directory:
f77 -O2 -c grafic1.f
make: f77: No such file or directory
make: *** [grafic1.o] Error 1
I have XCode and all associated command line tools installed, what could be causing this error?
This error is make telling you that you have no binary in your path called f77. There are two things you need to look at the fix this:
Do you have a Fortran compiler installed? MacOS X/Xcode does not come pre-installed with one by default. The easiest options to install one are via third-party tools like macports or homebrew where you can install gfortran which may be a standalone package or may be part of the gcc package.
Once you have a compiler installed, your makefile needs to know about it. Without seeing the makefile this is only an assumption, but if autotools are not used the fortran compiler is usually hardcoded in a variable called FC, e.g. you might see a line
FC=f77
and you would change this to
FC=gfortran
assuming gfortran is in your path.
Once you have a Fortran compiler installed and the makefile knows about it, you should be able to execute make successfully.

How to compile jxrlib on windows

I am looking for a library for working with JPEG-XR images and imagemagick refers me to jxrlib provided by Microsoft.
There are no pre-built binaries. The source code comes with a make file, but when I try to build it using GnuMake, I run into errors saying that a .o file was not found.
cc -I. -Icommon/include -Iimage/sys -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O
-Ijxrgluelib -c jxrgluelib/JXRGlue.c
process_begin: CreateProcess(NULL, cc -I. -Icommon/include -Iimage/sys -D__ANSI_
_ -DDISABLE_PERF_MEASUREMENT -w -O -Ijxrgluelib -c jxrgluelib/JXRGlue.c, ...) fa
iled.
make (e=2): The system cannot find the file specified.
make: *** [JXRGlue.o] Error 2
How do I compile this on Windows?
If you happen to have Visual Studio installed, just open the included solution files and build. That has always worked for me. I can't say anything regarding other toolchains under Windows, but I know that it also builds successfully with make and gcc under Ubuntu.
If you can't get it to compile I can share binaries if that helps you.
Visual Studio project files have been added to jxrlib project. See Add vc14 project and solution files commit in the official repository at https://jxrlib.codeplex.com
Alternatively, use CMake configuration proposed here in Patch for warnigns + CMake for building.

Makefile error on windows

I am trying to run makefile on windows7. I have added make.exe in windows path variable and
I am trying to run "make -f makefile.txt" but it shows error
"cc -o edit main.o kbd.o command.o display.o insert.o search.o files.o utils.o
process_begin: CreateProcess(NULL, cc -o edit main.o kbd.o command.o display.o i
nsert.o search.o files.o utils.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [edit] Error"
Please help me as i am new to make concept.
It is not sufficient to just add make.exe to the path. Your problem is that cc can not be found while trying to make the target called edit. Try running the same command from an MinGW/MSYS or CygWin shell, depending on how you installed this. That will most likely give you the proper environment to use make with this makefile.
This issue is similar to copy a file using a makefile at runtime
To make it work install MinGW (mingw-get-setup.exe) which will install mingw-get.exe utility that could be used to install all needed build tools.
With C:\Mingw\bin (or whatever path selected during installation) on $PATH type in console:
$ mingw-get.exe gcc g++ msys-base
After it finishes MSYS env will be available with all necessary tools (execute C:\MinGW\msys\1.0\msys.bat to open it)
Now you can use make like in unix envs.
Mike#Mike-PC ~
$ make
make: *** No targets specified and no makefile found. Stop.
If it is not enough install mingw32-make as well with mingw-get.
For some things on windows you'll want to install coreutils. I had this issue for nordic nrf micro issues with make but it's the same error
http://gnuwin32.sourceforge.net/packages/coreutils.htm
Landed here on a re-install of windows scratching head. This was the fix as it adds a bunch of useful commands to windows. Like why did "ls" work on my old drive and not the new one... answer core-utils. Why does it build everywhere and not here -- core-utils. Hope this helps someone in another 8 years.

Resources