PDcurses release compile on VC++ fail - pdcurses

I have an application using PDCurses. It compiles fine under debug, but when I try to compile in release mode, I get the following error:
main.cpp(1): fatal error C1083: Cannot open include file: 'curses.h': No such file or directory
I don't know if I havn't set up the linker properly or what the cause may be. Any ideas?

This message is looking for the header file: curses.h. This specific message is not related to the linker. There is probably an #ifdef which includes this only when doing a release build, but does not include it when doing a debug build (which may or may not be an error). Most likely the path for the header file is not specified to your compiler. I am not sure which compiler/version you are using, but you can add additional paths to search for header files. This will be in the compiler options.
EDIT: Look in the file main.cpp and you should see a line which #includes the file 'curses.h'. However, it could also be one of the header files you include there which in turn includes this file.

Related

How to add sysroot option in cross-compilation?

I am following sysdev tutorial, and have not build compiler with sysroot flag. ../binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot (forgot the last one).
So the problem is, when I have included compiler defined header <stdint.h> (somewhere in source, it is not important for the error), the error arise:
/home/user/opt/cross/lib/gcc/i686-elf/8.3.0/include/stdint.h:9:16: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
I have looked at the file a find:
...
...
# include_next <stdint.h>
...
1)
So why is used preprocessor macro #include_next, how does it differ from basic #include.
2)
How to solve the error of course. As the header of this question suggest, I have found this question: stdint.h "no such file or directory" error on yocto sdk. There someone said, there is missing the
3)
sysroot, but I have no idea what it is (whether root permission?) and how to add it in my compilation (if even) with some flag? Or need to build once again the cross compiler (but rather avoid this option). Or does it require to have special folder with the header, so it is visible for the compiler? Really do not know.
Edit:
When tried to edit the file and change the #include_next to just #include, even more error arise, so rather do not do that (have changed that back), so that macro is even more magic to me, as I saw it for the first time

Adding an Objective-C++ file to a C++ Xcode 5 project

I am attempting to add an ObjC++ file to a large Xcode 5 C++ project.
For legacy reasons, the "Compile Sources As" setting must remain "C++". If I could change this setting to "According to File Type" the ObjC++ file would build properly, but it won't compile if Xcode thinks its a C++ file.
I have tried explicitly setting the Type of the .mm file under Identity and Type to "Objective-C++ Source" and the compiler still attempts to build it as a C++ file. I have tried adding the "-ObjC" and "-ObjC++" compiler flags to to the individual file under Build Phases > Compile Sources, and I get a warning that the argument is unused during compilation.
I have tried this process in reverse, adding an ObjC++ file to a different project that is compiling sources as "According to File Type," and setting the Type to C++. As expected, the file fails to build. This shows that specifying the type of an individual file takes precedence over the project setting.
Is there no way to force Xcode5.1.1/llvm5.1 to build a single ObjC++ or ObjC file as the correct type? The project setting is overridden by the individual file setting in every case I've tested, except trying to build an ObjC++ file. Is this a bug or missing feature?
You were close with the ObjC++ flag.
Set the file's Compiler Flags in the Compile Sources Build Phase to -x objective-c++ $(inherited).

dev cpp win32 the program can't start because sqlite3.dll is missing

I am using dev c++ IDE which used ming gcc(i am not sure of it)
I wanted to use sqlite3 in my win32 c application
I downloaded sqlite3.dll and sqlite3.dev and used dlltool to create a .a file like libsqlite3.a and pasted in the lib folder of dev cpp and added this path in the project options -> parameters
i copied the header file sqlite3.h into the include folder(which i got from another website - http://www.opensource.apple.com/source/SQLite/SQLite-74/derived_source/sqlite3.h)
i executed the program and got the message 'the program can't start because sqlite3.dll is missing in your computer'
so i copied the sqlite3.dll into my working directory and then it worked
BUT
How to make the sqlite.* static while compiling?
I mean i thought by including the libsqlite3.a, the final exe will not be dependent of any external dll's.
So i want to know how to compile in a way that i will not be needing a dll and by doing so it makes my windows program standalone.
do i have a create a .lib file instead of .a file?
EDIT after answers and comments:
Besides, the devpak is working fine... yet i wanted to know how to include files to project or to create .a files so i am trying this way because if some components do not provide devpak then this will be the way we need to compile.. isn't it?
EDIT to show what i have done after the answer by CL and the two comments
This is how i have added the sqlite.c to project list
Here is the compile log
Compiler: Default compiler
Building Makefile:
"C:\Users\jayapalc\Documents\test-sqlite\Makefile.win"
Executing make...
make.exe -f "C:\Users\jayapalc\Documents\test-sqlite\Makefile.win" all
g++.exe -c sqlite3.c -o sqlite3.o -I"lib/gcc/mingw32/3.4.2/include"
-I"include/c++/3.4.2/backward" -I"include/c++/3.4.2/mingw32" -I"include/c++/3.4.2" -I"include"
sqlite3.c: In function `void strftimeFunc(sqlite3_context*, int,
sqlite3_value**)':
sqlite3.c:14727: error: invalid conversion from void*' tochar*'
The files i got in sqlite.org/sqlite-amalgamation-3071502.zip are
shell.c, sqlite3.h, sqlite3.c, sqlite3ext.h and i saw in other discussions that shell.c is not needed...
Besides, people were talking about gcc and g++... .
Apart from updating Dev-C++ itself, try this to compile sqlite.c as a C file:
Go to Project >> Project Options >> Files.
Find the C file we're talking about. Untick "Compile file as C++".
This should inform Dev-C++ that it should invoke gcc.exe, and not g++.exe.
If you don't want to compile sqlite yourself by adding it to your project, you can try passing the -static flag to GCC/G++ to force it to link libsqlite.a statically.
Just include the sqlite3.c file in your project.
You need only this filed, and it must be compiled as C, not C++.
Apparently, Dev-C++ does not allow mixing C and C++ source files in one project.
Instead, you could try to compile sqlite3.c as C and then include the generated .o file into the C++ project (on the Linker page).

Linker error despite including the files

I am having a linker error LNK 2001 unresolved external symbol.My point is I do have the respective include directory added under Project Settings->C/C++->General ->Additional Include .I see that this include directory does have the header file which contains the function which is causing the error.
I also add all the lib folders under linker options->general->additional lib dependencies.
What could be going wrong? How can I trace what file is missing?
You need more than just the library path, you need to specify the libraries explicitly. i.e something.lib
(under Linker->Input->Additional Dependencies in VS2005)
Linker errors have nothing to do with include files. You get compiler errors from missing include files/directories. The linker needs the actual definitions aka code to work its magic and create your binary file (exe/dll/static library etc...).
Are you linking to the library of which you are #includeing the headers from?

Linking in Xcode

How do I make Xcode link object files properly?
The file containing "main" and all the dependencies compile properly (and I can easily link them in the command line to generate the executable). However, Xcode seems to refuse to do it, resulting in ld errors of "symbol not found".
This is what my current setup looks like. All the dependencies (Calculator, input, etc) are detected and compile properly. The cpp file contains main but fails to be linked to the .o file (generated by the dependencies), resulting in several ld "symbol not found" errors.
Any ideas?
.o's generated by dependencies do not get linked into the including target. In the example above, "Calculator" needs to generate something, generally a static library (.a), that you would then add to the list of libraries to be linked into the project.

Resources