FAQ Database Discussion Community


lpsolve library dynamically linking

linux,cc,lpsolve
the lpsolve library has a script to build a demo.c file. #This script expects to be located in a subdirectory of a subdirectory of the base lpsolve files cc -DEXPLICIT -I../.. -O3 demo.c explicit.c -lm -ldl -o demoe ../../lpsolve55/liblpsolve55.so opts='-O3' opts='' cc -I../.. $opts demo.c implicit.c -lm -ldl -o demoi...

“Illegal use of selector” in C

c,cc,minix
As part of a larger project, I am trying to write a C function that searches an implemented sorted linked list for a value in the struct olnode. I'm receiving a few errors, however. I'm new to C and I'm struggling with pointers and double pointers and when to use...

Segmentation fault with Sun c++ compiler

c++,segmentation-fault,multimap,cc
I have a class AccountMap in AccountMap.h and AccountMap.cpp. It reads stuff from a binary file (which is ok) and outputs stuff. It runs perfectly fine on g++ compiler but gives me a seg fault on sun c++ CC compiler when I use new operator for the 10 iteration in...

How to get CMake to use the default compiler on system PATH?

linux,path,cmake,cc
There is the same question and the answer. The problem is that the answer seems to be wrong (actually is not the answer to the asked question). Can I re-ask the question? The problem: $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games $ whereis gcc cc: /usr/bin/gcc /usr/lib/gcc /usr/local/bin/gcc /usr/libexec/gcc $ which gcc /usr/local/bin/gcc...

Generic Makefile not working on FreeBSD

makefile,make,freebsd,cc
Please note that this is not a duplicate of the other questions named generic makefile. I have followed all of the instructions on other questions about generic makefiles, and this is the code I have come up with from that: CFLAGS = -c CC = cc SOURCES = $(wildcard *.cc)...

How to determine macro value at compilation time in C?

c,compilation,macros,cc
If I have a macro in my C: #ifdef SIGDET #if SIGDET == 1 isSignal = 1; /*Termination detected by signals*/ #endif #endif How can I set the value at compilation time? Is it some parameter to the compiler?...

“void not expected” in C

c,cc,minix
I have the below code in a larger C program. I've had no issues until just now when I tried to compile it; it's being run in Minix 2.0.4 and compiled using cc. A compilation error is thrown as follows: line 26: void not expected Line 26 is simply a...