When I am trying to access files from standard usr/ it is not working. and showing errors that file is missing .
I have added path but and make it work but i think this is not the correct way.
I have a workspace with 10-12 projects which are of c and cpp both.
In one project I am using cpp with thrift libraries and protocol.
in that project only I am facing issue. with I am individually building that project it is working but when building it from the main project. it starts showing error in files.
There all almost 17 projects and 16 are generating .so files and all are going to the main project. and main is generating an executable. and that executable uses all the .so files.
but In thrift only it is showing errors. before it was showing for #include i added that file so now it is showing undefined type Name Space ..
I think this issue is because of relative path but I am not sure
Please Help
Related
I'm writing an SDL2 program which needs to find images on the filesystem to draw to the screen. On the Linux and Windows builds, this works perfectly and the images appear how they should. However, when compiling with Emscripten, the app tells me that the image file wasn't found. I made the program print its working directory (which is /), then I used the JavaScript console to check what files where the files were and the image file is in the directory that the program expects. Why can't the Emscripten-compiled version find my file?
I'm trying to do a project which uses SDL2 to do the graphics.
I want to have my project files in a directory.
I have the functions that manipulate the SDL directly and pictures in a subdirectory of this (UI_library).
I solved the compiling part by adding to the compilation commands
-LUI_library
The problem is that when I run the program, it can't find the pictures, since it assumes they are in the project directory and not in the subdirectory.
Do you know how to fix this without manually changing the code in the subdirectory? There are a lot of references to the pictures in the library.
One way to solve this problem would be addressing the whole path to your file.
For Example:
Windos:
SDL_LoadBMP("C:\Documents\your_image.bmp")
Linux:
SDL_LoadBMP("/home/tigre200/Documents/your_image.bmp")
I am using eclipse (2018-12) with a friend of mine on a C project. We analyse code from the same eclipse project on a local network (he imported my project). He's got a different version of Eclipse than me (he uses mars). Each of us got a different workspace, however the project folder is shared.
He tried to add symbols (File > Properties > C/C+++ General > Paths and Symbols) and since then the window no longer shows the "Symbols" tab but this:
Eclipse configuration bug
The error is this one:
Orphaned configuration. No base extension cfg exists for
cdt.managedbuild.config.llvm.clang.win32.mingw.exe.debug.1048177015
We only analyse the code (no editing). As the code remains unchanged on both computers, I suppose the problem we have come from the project configuration files.
Do you have any idea how to fix this problem ?
i have a question that google couldn't solve. thing is i am currently working in a project with around 15 other people. some of us use eclipse and some use clion. the problem is that clion uses a "CMakeLists.txt" file in which specifies all files to be compiled. Eclipse doesn't use this file, but the ones using clion complain that they have to manually add all .c files created in eclipse in that file in order to compile the project. is there a way to get around this? thanks
I wanted to learn how to use a .lib file in my C application.
So, I followed these steps:
Created a empty project in VC++,
Added a .c file,
Added few c functions,
Created a .h file for the same,
Changed the projects type to .lib
Built the project.
No problem till here.
Now,
I copied the .h and the .lib file to desktop,
created another VC++ empty project of type .exe,
In poject prop.->config. prop.->c/c++->additional include directories,I added the path to desktop,
In poject prop.->config. prop.->linker->additional library dependencies,I added the path to desktop,
building the project gives LNK2019 (unresolved external symbol _...) and fatal error LNK1120 (unresolved external symbols).
What am I doing wrong? Also what would be the steps to use a .dll instead of .lib?
Configuration: Windows 7, VS2008.
You also have to add the library by name to the list of Additional Dependencies in Linker->Input options for your Project.
Do you really want this linked in from the desktop, by the way? Typically some project-relative path or environment variable would be the way to do this - you do not want to link from desktop on a build server, for example.
Switching to a DLL will not help because you still need to use the export library (.LIB) file for your DLL to satisfy the link-time dependencies.