Problem in compiling in release mode --VC++ - visual-studio

I am compiling my project in the release mode in VC++.
I have a .def file where i have declared the setLog and now i
am getting following error
Linking...
Creating library Release/HKL.lib and object Release/HKL.exp
HKL_libinterface.obj : error LNK2001: unresolved external symbol _SCTP_setLog#8
Please help me on the above to fix the problem.
Thanks

It sounds to me like you have a lib file configured in your debug build that is not in the release build. Your setLog() function does not seem to be the function the linker is complaining about - it sounds like it's not finding a function called SCTP_setLog().
Look in the list of libraries you have configured in your project's debug configuration and make sure they are also configured in the release configuration.

If this compiles in Debug mode the most possible reason is that somehow the code where this function is implemented is not included into build - for example, the cpp file where it is implemented has "Excluded from build" set.

As sharptooth mentioned, you most likely are not compiling the above function in your release build. In addition to looking for 'Excluded from build', check if you have any defines set (or not set) that would exclude the missing function from your release build.

Related

How to add missing dependencies in android 9?

we are working in android pie BSP, while building the file we are getting some missing dependencies error but we added the missing libraries in vendor/lib folder that is externally compiled file. is there any way to access the library or can anyone tell where to place the library to access?
The error is
frameworks/base/cmds/simpletriangle_vivante-fb/Android.mk: error: simpletriangle_vivante-fb (EXECUTABLES android-arm) missing libEGL-fb (SHARED_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
frameworks/base/cmds/simpletriangle_vivante-fb/Android.mk: error: simpletriangle_vivante-fb (EXECUTABLES android-arm) missing libGAL-fb (SHARED_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
frameworks/base/cmds/simpletriangle_vivante-fb/Android.mk: error: simpletriangle_vivante-fb (EXECUTABLES android-arm) missing libGLESv2-fb (SHARED_LIBRARIES android-arm)
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
First, Make Sure that you have the latest hardware files.
You can ALLOW_MISSING_DEPENDENCIES=true in Your BoardConfig.mk

Unresolved reference 'DeserializeFromUInt16' using ANTLR for Go

I'm creating a grammar to run a console application, using VSCode or IntelliJ extensions everything seems fine with my .g4 grammar file. But when I execute the command to get the antlr/parser folder:
antlr4 -Dlanguage=Go -o parser items.g4
I get the following errors from the items_lexer.go and items_parser.go files:
Unresolved reference 'DeserializeFromUInt16'
Unresolved reference 'DecisionToState'
Unresolved reference 'DecisionToState'
The first one appears in the following line:
var lexerAtn = lexerDeserializer.DeserializeFromUInt16(serializedLexerAtn)
Which uses the var: lexerDeserializer declared in the previous line:
var lexerDeserializer = antlr.NewATNDeserializer(nil)
And here is the origin of the problem, directly from antlr lib for some reason the DeserializeFromUInt16 func is not founded. I already tried using another grammar. Im using ANTRL 4.7.2, and I made sure to had a jdk installed, the go get github.com/antlr/antlr4/runtime/Go/antlr, and the .jar folder in my project.
I would appreciate any kind of suggestions about how can I free my files from errors.

Does proguard support GCM?

I receive this error when I try to rebuild app with proguard: (I tried all the solutions suggested for the error MSB6006: "java.exe" exited with code 1, but in my case, it seems have some conflicts with GCM )
19>PROGUARD : warning :
com.google.android.gms.common.GooglePlayServicesUtil: can't find
referenced method 'void
setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)'
in class android.app.Notification 19>PROGUARD : warning :
com.google.android.gms.gcm.zza: can't find referenced method 'void
setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)'
in class android.app.Notification 19> You should check if you
need to specify additional program jars. 19>PROGUARD : warning : there
were 2 unresolved references to program class members. 19>
Your input classes appear to be inconsistent. 19> You may
need to recompile them and try again. 19> Alternatively, you
may have to specify the option 19>
'-dontskipnonpubliclibraryclassmembers'. 19> java.io.IOException:
Please correct the above warnings first. 19> at
proguard.Initializer.execute(Initializer.java:321) 19> at
proguard.ProGuard.initialize(ProGuard.java:211) 19> at
proguard.ProGuard.execute(ProGuard.java:86) 19> at
proguard.ProGuard.main(ProGuard.java:492) 19> Picked up
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8 19>C:\Program Files
(x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2118,3):
error MSB6006: "java.exe" exited with code 1.
The Google GMS libraries sometimes try to access library methods that are not available for a given target SDK version and gracefully handle errors at runtime. So it is usually required and safe to add something like this to ignore such warnings:
-dontwarn com.google.android.gms.**
-dontnote com.google.android.gms.**
These rules will ignore all warnings and notes from the gms libraries.
I solved it with this solution from Xamarin forum:
Create file named proguard.cfg inside Android project in the solution. Right click and set Build Action to ProguardConfig.
Add the following lines:
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
Amend the above according to type of errors you're getting
Make sure you save file as UTF-8 and NOT UTF-8 BOM
Compile version: 6.0
Min target: 5.1
Target version: 6.0

Compiling Bzip2 with C++11

I'm trying to compile the MultiBoost Library with C++11 but I can't make it work. The problem seems to be with the BZip2 Library that is used internally. More specificly there is a wrapper called Bzip2Wrapper to provide a c++ interface to the C library. All the files of the C library are included in the same folder. When using the default make file everything works but when I change
project(multiboost)
to
project(multiboost CXX)
I get the following errors:
libMultiBoostLib.a(Serialization.cpp.o): In function `Bzip2WrapperReader::open(char const*)':
Serialization.cpp:(.text._ZN18Bzip2WrapperReader4openEPKc[_ZN18Bzip2WrapperReader4openEPKc]+0x97): undefined reference to `BZ2_bzReadOpen'
Serialization.cpp:(.text._ZN18Bzip2WrapperReader4openEPKc[_ZN18Bzip2WrapperReader4openEPKc]+0xc5): undefined reference to `BZ2_bzReadClose'
libMultiBoostLib.a(Serialization.cpp.o): In function `Bzip2WrapperReader::close()': ...
The CMakeList file looks like this
# Bzip2
file(GLOB bzip2_SRCS "${BASEPATH}/Bzip2/*.cpp" "${BASEPATH}/Bzip2/*.c" "${BASEPATH}/Bzip2/*.h")
add_library(Bzip2Lib STATIC ${bzip2_SRCS})
#add_library(bzip2 SHARED ${bzip2_lib_SRCS})
...
# adding library to the exec
target_link_libraries(multiboost MultiBoostLib Bzip2Lib)
Any ideas what could go wrong? I don't even know what the problem is.
Thanks!
This does not look like a C++11 error but an error in the Build system.
I have not looked at the Code, but from the output you added something like this
target_link_libraries(MultiBoostLib PUBLIC Bzip2Lib)
should add the missing dependency from libMultiBoostLib on libBzip2Lib.
I found the problem. I was adding "CXX" to my project description which disabled the use of C. Therefore the libraries (in C) could not be compiled. Changing it to "project(name C CXX)" solved this issue. I then also needed to include the line "set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")" to enable C++11 support. Now everything is working.
Thanks a lot!

How to setup which libraries link in RelWithDebugInfo build configuration?

I know how to link different libraries based on whether build configuration is Debug or Release. I use:
foreach(dep ${DEPENDENCIES})
target_link_libraries (${PROJECT_NAME}
debug ${dep}_d
optimized ${dep}
)
endforeach(dep)
CMake by default create 4 build configurations in VS2010 (Debug, Release, RelWithDebugInfo, MinSizeRelease). But how to define taget link libraries for RelWithDebugInfo configuration?
Bakcground:
I use only Debug, Release and RelWithDebugInfo. My debug libraries have suffix _d and others have no suffix. So output files from Release and RelWithDebugInfo are the same. Sometimes when I build RelWithDebugInfo and then Release some output files are not overwritten and thus bad ones are loaded and program crashes. I want to solve this problem by adding some other suffix to RelWithDebugInfo configuration.
I have found the solution. It is impossible to do via target_link_librearies but it can be done by setting linker flags:
set(DEBUG_DEP)
set(RWD_DEP)
set(RELEASE_DEP)
foreach(dep ${DEPENDENCIES})
set(RWD_DEP ${RWD_DEP} ${dep}_rwd)
set(DEBUG_DEP ${DEBUG_DEP} ${dep}_d)
set(RELEASE_DEP ${RELEASE_DEP} ${dep})
endforeach(dep)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG} " /LIBPATH:" ${DEBUG_DEP})
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE} " /LIBPATH:" ${RELEASE_DEP})
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO}" /LIBPATH:" ${RWD_DEP})

Resources