Hi
Can anyone to help me about this error when i build ffmpeg-3.4.1 with gnu under windows :
/tmp/9747a756ee05ef34cc3fcf51eabde826/sysroot/usr/include/unistd.h:173: error: undefined reference to '__page_size'
I set temp folder manually but GNU-Make tries to find above path.
My own guess is that gnu cannot create temp files and folders in Windows %TEMP% directory.
Solved: I found the problem was referred to android-ndk version.
Changing to from ndk-r14b to ndk-r10 fixed the issue!
Related
I created a project, which includes MiXiM.
The problem is that when I build the project I get this error:
/MiXiM/src/base/connectionManager/ConnectionManagerAccess.h:40:26: fatal error: BaseMobility.h: No such file or directory
I don't understand. The problem seems related to the MiXiM library but if I close my project, I can successfully compile every MiXiM example.
Is it a bug or am I doing smomething wrong?
You are probably trying to build MiXiM with a recent version of OMNeT++ (5.0 or later?). Since 5.0 OMNeT++ does NOT add all directories in the source tree as an include dir one by one. Only the root of the source folder is added. It means that ALL files that include other headers from a directory other than the current one MUST be prefixed with the path relative to the source folder root. Adding all directories to the include path was a very bad idea and was removed from OMNeT 5.
This leads to the next question: Why are you using MiXiM which is abandoned long ago and most of its functionality was merged into INET 3.x? Why not INET?
I don't know,if I can help you or not;but I had the same experience.
If you try to execute an old project in MIXIM with different version,you get this error.
For example,in MIXIM-2.2.1 there is BaseMobility;but in MIXIM-2.3 there is MobilityBase.Therefore,If your project was written in MIXIM-2.2.1,you should change it according to MIXIM-2.3.
I'm very new to spiderMonkey and have followed this tutorial to get started (I'm using MAC OS X): https://developer.mozilla.org/en/docs/How_to_embed_the_JavaScript_engine
Every time I try to do the linking command in Step 6:
cl helloworld.cpp -link dist/lib/mozjs185-1.0.lib
I get the following 2 problems:
1) mozjs185-1.0.lib is not present in any directory (I've downloaded both the spiderMonkey and Mozilla source code)
2) Once I edit the path to point to the .lib file I do have I get the following error: FloatingPoint.h not found. However, I can find FloatingPoint.h on the system just at a different directory.
Could anyone give me a clue as to in which directory these header files should be? Or how to get the required .lib file? I've followed instructions on the mozilla development site meticulously and still can't get a hang of this.
After a few hours battling with this, I've managed to link properly by adding the hello world.cpp file in the build-release folder (as described in the Build Documentation; for more info see: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation).
From the terminal, I then cd into the build-release folder and type in the following command:
g++ -Idist/include -Ldist/bin -lmozjs185 helloworld.cpp -o helloworld
Unfortunately I am still getting this error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/atomic:539:2: error: atomic is not implemented
I am pretty sure this has to do with the c++ compiler installed, and I still have to find a workaround, but at least it's properly linking now!
I am on Xubuntu x64 and I want to use ncurses in my software. This software is being build with Qt Creator 4.8. I have no problems including the ncurses.h file, but when I want to use functions of ncurses (initscr() and endwin()) I get the following errors:
Undefined reference to 'endwin'
Undefined reference to 'initscr'
What steps should I take to fix this problem?
I have installed the following ncurses related packages:
libncurses5:amd64
libncurses5:i386
libncurses5-dbg
libncurses5-dev
libncursesw5:amd64
libncursesw5:i386
libncursesw5-dbg
libncursesw5-dev
ncurses-base
ncurses-bin
ncurses-examples
I found out (finally)
The right way to do it: rightclick your project->add library -> system library
Here you need the path to the *.so file (so not *.so.5 or something), which was in my case
/usr/lib/x86_64-linux-gnu/libncurses.so
Then add it and tadaaa: done.
and I also found this guide may be it works, to me none has worked yet
http://www.lucidarme.me/?p=3961
"In the .pro file of the project, add the following line to specify to the compiler it has to use the ncurses library:
LIBS += -lncurses
To avoid the following error message : “Error opening terminal: unknown.”, add a variable in the run environment of Qt. Project -> Run -> Run environment -> add. Add a variable named TERM and set it of xterm."
UPD: my problem solved by checking the "Run in terminal" option in Projects->Run.
I'm a complete beginner with Code::Blocks and SQLite, and have some basic knowledge with C++. I'm currently using Ubuntu 11.04.
I have downloaded SQLite Amalgamation here. When I extracted the zip file, there are four files inside: shell.c, sqlite3.c, sqlite3.h, and sqlite3ext.h. If I simply add those files to a (for example) a console project, it gives out an error: the .c's of the downloaded sqlite each have their own main function. Removing those from the project, the errors are gone and I can call #include "sqlite3.h". I am trying to follow this, and tried the first two lines of code from here and it gives out an error: undefined reference to sqlite3_open.
I think adding those .h's directly to a console project isn't the right way to use it, though I'm not sure.
How exactly should I use those? What should I do to use those for my C++ program?
Any help is greatly appreciated. :)
EDIT: I also tried to create a .a file of those sqlite files by following this. When I try it, it gives out an error: cannot find -lsqlite.
I got it! Though there was something that I did that caused problems.. I forget to remove the .a file that I added at Project > Build Options > Linker Settings earlier, which caused problems..
Here are the steps I made to add SQLite: (for those that might have the same problems)
Copy the files extracted from the SQLite Amalgamation to the directory of the project.
Add the sqlite files (Project > Add Files) EXCEPT the shell.c (it is the one that causes the multiple function error)
Compile it (Yes, a simple Ctrl+f9).
here are errors: undefined reference to pthread_mutexattr..... These are fixed by going to Project > Build Options > Highlight 'the Project Name' above Debug and Release at the top left corner > Linker settings, and adding "-lpthread" (without quotes) to Other linker options:.
Some more errors are found: undefined reference to dlopen, dlerror..... Add '"-ldl"' just below the '"-lpthread"' added earlier.
DONE :)
I didn't find a complete answer for Windows as a beginner, and at the beginning it is very painful to understand everything. So here's what worked for me.
Download the SQlite Amalgamation file.
Open Code::Blocks -> New Project -> Choose static library
Unzip the file you have downloaded and copy the folder/contents to your new project directory. Add all the files to the project and build the project.
You will find a ProjectName.a file in the bin/Debug or bin/Release directory. Copy that file to your actual SQlite project directory.
Go to Code::Blocks Project->Build options. Select 'Linker Settings' tab and add the path to the .a file. Don't close it yet!!!
In 'Search Directories' tab, select the 'Compiler' tab, add the path to the Amalgamation header files, or copy the header files to your directory (you can add the header files to your project) and in the 'Linker' tab add the path to the .a file
Now Compile!!! Hopefully this will run
That is all, I wish it'll save some searching time for another noob
You will need to compile the sqlite code first, and then just #include "sqlite3.h" into your project where you need it.
UPD:
Try this:
Download this package from sqlite site and extract it somewhere, say, into a folder called "sqlite". Open terminal, and go into this folder. Inside of it, run
./configure
sudo make
sudo make install
and see what happens. It should build itself automatically. Consult the README file that is inside the archive too.
I compiled my program with intel C++ compiler for windows (from Intel Composer 2011), and got an error message that libmmdd.lib cannot be found. I googled this problem, and some people said that I have to reinstall my compiler, and I did; however, that didn't resolve the problem, so I started looking in the intel compiler directory, and found that this file (and other required libraries as well) are located at
%CompilerDirectory%\compiler\lib\ia32
It doesn't make sense to write in the make file the whole absolute path of the libraries, so I started searching, and I could only find that %mklroot% points to the math kernel directory. And even with a -L%mklroot%/../compiler/lib/ia32 approach for linking I couldn't link to the libraries correctly, so eventually I did a lame move to solve the problem, which is, I copied every file the linker asks for to the source directory, and so was the problem temporarily solved.
Since this way of solving the problem isn't the best one, I wonder if there's a way to link to those libraries without having to copy the files. It's strange because the compiler should find its own libraries alone, but... I don't know...!
Any ideas? is there something like, %compilerroot%, that points to the compiler directory and that I could put in my makefile (or actually my qmake, since I'm using Qt).
Thanks for any efforts :-)
Instead of using %mklroot% try $$(mklroot) or $(mklroot).
You can find the explanation here:
Variables can be used to store the contents of environment variables.
These can be evaluated at the time that qmake is run, or included in
the generated Makefile for evaluation when the project is built.
To obtain the contents of an environment value when qmakeis run, use
the $$(...) operator:
DESTDIR = $$(PWD)
message(The project will be installed in $$DESTDIR)
In the above assignment, the value of the PWD environment variable is
read when the project file is processed.
To obtain the contents of an environment value at the time when the
generated Makefile is processed, use the $(...) operator:
DESTDIR = $$(PWD)
message(The project will be installed in $$DESTDIR)
DESTDIR = $(PWD)
message(The project will be installed in the value of PWD)
message(when the Makefile is processed.)
In the above assignment, the value of PWD is read immediately when the
project file is processed, but $(PWD) is assigned to DESTDIR in the
generated Makefile. This makes the build process more flexible as long
as the environment variable is set correctly when the Makefile is
processed.
EDIT:
It is strange that neither $$(mklroot) nor $(mklroot) gave you the result you would expect. I did a simple test to verify what I wrote above:
Opened a Command Prompt
Created a new environment variable 'mklroot' with a test value: set mklroot=C:\intel_libs
Verified the result of the previos step: echo %mklroot%. I got C:\intel_libs
Placed your 3 qmake functions at the end of my .pro file:
warning($(%MKLROOT%))
warning($(MKLROOT))
warning($$(MKLROOT))
Ran qmake: qmake. The result:
Project WARNING:
Project WARNING: c:\intel_libs
Project WARNING: c:\intel_libs
As you can see the 2nd and the 3rd warning() displayed the string I set to the environment variable.