User Profile
Collapse
-
Try to write a driver for your graphics board for Linux Ubuntu OS! -
That is exactly what I wanted to do. But as I now know, obj-Files compiled from c are not compatible with cpp. You have to tell the compiler that you want to use a function defined in c explicitly.
Anyway, I'm just using quite basic c which should be compilable by an cpp compiler.Leave a comment:
-
Unfortunately, often it IS the problem to know which information is relevant and which not. If I guessed that the problem is with the c-Files, I propably had not posted this problemLeave a comment:
-
Maybe I should have mentioned that I wanted to link obj-Files compiled from c-sources... Now that I renamed all c-Files to cpp everything workes fine :)
Thank you anyway!Leave a comment:
-
In order to omit the "goto", it's better to use a while-loop:
Code:bool validInput = false; while(!validInput) { cout << "Enter a number greater than 0 "; cin >> num1; if(num1 > 0) validInput = true; }
Leave a comment:
-
Including relative paths into VS-Project
In order to structure my code I'm using different folder for my source and header files. Unfortunately, the builder would not find the included headers and output following error:
fatal error C1083: Include-File cannot be opened: 'util.h': No such file or directory
I want the compiler to look for the path relative to the project folder but it seems that he is only looking in the folder of the source to be compiled. I... -
Question: Why do you use dynamical memory allocation at all? Just type
Code:CheckSwapClear mySwapClearChecks;
Generally: Only use "new" if you need a variable outside of the block where it is allocated. Even then it might be better to copy the variable into another allocated on the stack instead on the heap. Saves you alot of troubleLeave a comment:
-
Another option:
Get yourself a string, read it in and parse it: You have to do some string operations to extract the '+' charaters and convert the rest to int (see atoi). Doing so, you have full control about what to accept as sound input.Leave a comment:
-
Sure. I declared the function in a header, defined it in a source and included the header in the source-File using it (Test1Dlg). I compiled the source of the function independently with success so its obj-File is available in the Debug-Folder....Leave a comment:
-
Thx for your help so far!
The function is NOT available via a library but as a obj-File located in the same dir than its header. Thats why Im expecting the linker to find it. Actually, all obj-Files are in the Debug-Folder where the compiler put them.Leave a comment:
-
error LNK2001: Linking error with VS C++ 6.0
When building my project, I'm getting following error:
Test1Dlg.obj : error LNK2001: unresolved external symbol "int __cdecl get_contact_sta te(enum CONTACT)" (?get_contact_s tate@@YAHW4CONT ACT@@@Z)
Debug/Test1.exe : fatal error LNK1120: 1 unresolved externals
I have included the function by it's header in Test1Dlg.cpp so it should work. There is no error if I dont call the function.
The directory...
No activity results to display
Show More
Leave a comment: